Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Services and the fly likes Exception in WSDL2Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Exception in WSDL2Java" Watch "Exception in WSDL2Java" New topic
Author

Exception in WSDL2Java

Viru Sagar
Greenhorn

Joined: Oct 29, 2007
Posts: 8
Hi All,

I ahve the following WSDL file and it has a schema defined with name "ConcatS", which is further referenced as a part of a message.

But when I try to generate the sourcecode, i get following error

java.io.IOException: Type {http://www.example.org/WSDLFile/}ConcatS is referenced but not defined.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/WSDLFile/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WSDLFile" targetNamespace="http://www.example.org/WSDLFile/" xmlns:p="http://schemas.xmlsoap.org/wsdl/http/">
<wsdl:types>
<xsd:schema targetNamespace="http://www.example.org/WSDLFile/">
<xsd:element name="ConcatS">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="String4" type="xsd:string"></xsd:element>
<xsd:element name="String2" type="xsd:string"></xsd:element>
<xsd:element name="String3" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="NewOperationRequest">
<wsdl:part name="NewOperationRequest" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="NewOperationResponse">
<wsdl:part name="NewOperationResponse" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="ConcatRequest">
<wsdl:part name="testPart" type="tns:ConcatS"></wsdl:part>
</wsdl:message>
<wsdl:message name="ConcatResponse">
<wsdl:part name="ConcatResponse" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:portType name="WSDLFile">
<wsdlperation name="NewOperation">
<wsdl:input message="tns:NewOperationRequest"/>
<wsdlutput message="tns:NewOperationResponse"/>
</wsdlperation>
<wsdlperation name="Concat">
<wsdl:input message="tns:ConcatRequest"></wsdl:input>
<wsdlutput message="tns:ConcatResponse"></wsdlutput>
</wsdlperation>
</wsdl:portType>
<wsdl:binding name="WSDLFileSOAP" type="tns:WSDLFile">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdlperation name="NewOperation">
<soapperation soapAction="http://www.example.org/WSDLFile/NewOperation"/>
<wsdl:input>
<soap:body namespace="http://www.example.org/WSDLFile/" use="literal"/>
</wsdl:input>
<wsdlutput>
<soap:body namespace="http://www.example.org/WSDLFile/" use="literal"/>
</wsdlutput>
</wsdlperation>

<wsdlperation name="Concat">
<soapperation soapAction="http://www.example.org/WSDLFile/Concat"/>
<wsdl:input>
<soap:body namespace="http://www.example.org/WSDLFile/" use="literal"/>
</wsdl:input>
<wsdlutput>
<soap:body namespace="http://www.example.org/WSDLFile/" use="literal"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:service name="WSDLFile">
<wsdl:port binding="tns:WSDLFileSOAP" name="WSDLFileSOAP">
<soap:address location="http://www.example.org/"/>
</wsdl:port>
<p:address location="http://127.0.0.1:8080/SimpleWebService"></p:address></wsdl:service>
</wsdl:definitions>
Viru Sagar
Greenhorn

Joined: Oct 29, 2007
Posts: 8
When I use
"<wsdl art name="testPart" element="tns:ConcatS"></wsdl art>" It works fine. But based upon my study from an article :
If RPC Style messaging is used then part element must have "type" attribute instead of element.

With the following I can not generate the Java code.
"<wsdl art name="testPart" type="tns:ConcatS"></wsdl art>"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in WSDL2Java