Hello everyone. Because of my lack of skills, I simply can’t start any web-service if I have valid schema in wsdl-file and wsdl2java.

 

WSDL2Java works fine as long as I use e.g. xsd:string and  apachesoap:Element in requests and responses.

<wsdl:part name="ListDocumentsReturn" type="apachesoap:Element"/>

<wsdl:part name="name" type="xsd:string"/>

Above are the examples that I can easily use and start to write my own code into automatically generated XXXXXBindingImpl.java file. And everything works fine! E.g. apachesoap:Element generated as: “public org.w3c.dom.Element ListDocuments(org.w3c.dom.Element XXXXX) throws java.rmi.RemoteException {“ …. in XXXXXBindingImpl.java file.

 

 

When I try to use accurate schema in a source WSDL, I’ll meet troubles.

<wsdl:types>

<schema targetNamespace="http://ce.vtt.fi/HelloWorld/HelloWorld.wsdl" xmlns="http://www.w3.org/2001/XMLSchema">

<complexType name="Input">

<sequence>

<element ref="tns2:HelloWorld"/>

</sequence>

</complexType>

</schema>

<schema targetNamespace="http://ce.vtt.fi/HelloWorld/HelloWorld.xsd" xmlns="http://www.w3.org/2001/XMLSchema">

<!-- <xsd:element name="ClaimDetail" type="types:ClaimDetailType"/> -->

<element name="HelloWorld">

<complexType>

<sequence>

<element name="HuuHaa">

<complexType>

<attribute name="Huu" type="string" use="required"/>

<attribute name="Haa" type="string" use="required"/>

</complexType>

</element>

</sequence>

<attribute name="UserID" type="string" use="optional"/>

<attribute name="AccessState" type="string" use="optional"/>

</complexType>

</element>

</schema>

</wsdl:types>

 

 

 

After wsdl2java and deploy in Axis Tomcat I shall get instead of WSDL e.g. a folloving error.

AXIS error

Sorry, something seems to have gone wrong... here are the details:

Fault - makeTypeElement() was told to create a type "{http://ce.vtt.fi/HelloWorld/HelloWorld.xsd}>HelloWorld", with no containing element

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
 faultSubcode: 
 faultString: makeTypeElement() was told to create a type "{http://ce.vtt.fi/HelloWorld/HelloWorld.xsd}>HelloWorld", with no containing element

 

My Question is:

Do you know any help or good “HOW-TO” documentation of using accurate schemas in WSDL and then use wsdl2java and deploy successfully?

 

 

 

 

Thank You in an advance and merry Christmas!

 -Ilkka-

[EMAIL PROTECTED]

 

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Ilkka Heinonen (VTT) -->
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:impl="http://ce.vtt.fi/HelloWorld/HelloWorld.wsdl"; xmlns:intf="http://ce.vtt.fi/HelloWorld/HelloWorld.wsdl"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:tns2="http://ce.vtt.fi/HelloWorld/HelloWorld.xsd"; xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; targetNamespace="http://ce.vtt.fi/HelloWorld/HelloWorld.wsdl";>
	<wsdl:types>
		<schema targetNamespace="http://ce.vtt.fi/HelloWorld/HelloWorld.wsdl"; xmlns="http://www.w3.org/2001/XMLSchema";>
			<complexType name="Input">
				<sequence>
					<element ref="tns2:HelloWorld"/>
				</sequence>
			</complexType>
		</schema>
		<schema targetNamespace="http://ce.vtt.fi/HelloWorld/HelloWorld.xsd"; xmlns="http://www.w3.org/2001/XMLSchema";>
			<!-- <xsd:element name="ClaimDetail" type="types:ClaimDetailType"/> -->
			<element name="HelloWorld">
				<complexType>
					<sequence>
						<element name="HuuHaa">
							<complexType>
								<attribute name="Huu" type="string" use="required"/>
								<attribute name="Haa" type="string" use="required"/>
							</complexType>
						</element>
					</sequence>
					<attribute name="UserID" type="string" use="optional"/>
					<attribute name="AccessState" type="string" use="optional"/>
				</complexType>
			</element>
		</schema>
	</wsdl:types>
	<wsdl:message name="ListProductsResponse">
		<wsdl:part name="ListProductsReturn" element="tns2:HelloWorld"/>
	</wsdl:message>
	<wsdl:message name="ListProductsRequest">
		<wsdl:part name="ListProducts" type="impl:Input"/>
	</wsdl:message>
	<wsdl:portType name="HelloWorld">
		<wsdl:operation name="ListProducts" parameterOrder="ListProducts">
			<wsdl:input name="ListProductsRequest" message="impl:ListProductsRequest"/>
			<wsdl:output name="ListProductsResponse" message="impl:ListProductsResponse"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="HelloWorldSoapBinding" type="impl:HelloWorld">
		<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="ListProducts">
			<wsdlsoap:operation/>
			<wsdl:input>
				<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://ce.vtt.fi/HelloWorld/HelloWorld.wsdl"/>
			</wsdl:input>
			<wsdl:output>
				<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://ce.vtt.fi/HelloWorld/HelloWorld.wsdl"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="HelloWorld">
		<wsdl:port name="HelloWorld" binding="impl:HelloWorldSoapBinding">
			<wsdlsoap:address location="http://localhost:1234/axis/services/HelloWorld"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>

Reply via email to