This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Errors in WSDL2Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Errors in WSDL2Java" Watch "Errors in WSDL2Java" New topic
Author

Errors in WSDL2Java

sravant puto
Greenhorn

Joined: May 18, 2007
Posts: 4
Hi,

I have a WSDL file and i am generating java stubs for that WSDL using eclipse plugins.
Axis version I am using is 1.3 and Tomcat5.5
I am getting compilation errors in the stubs as all the classes are not getting generated.
I have no idea why the class 'NikuDataBus' is not getting generated.
Here is the source of WSDL file:-
<definitions xmlns:tns="http://www.niku.com/xog/Object"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="Movies"
targetNamespace="http://www.niku.com/xog/Object">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://www.niku.com/xog/Object">
<xsd:complexType name="NikuDataBus">
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="XOGOutput">
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ReadMOVIE" type="tns:NikuDataBus"/>
<xsd:element name="ReadMOVIEResponse" type="tns:NikuDataBus"/>
<xsd:element name="WriteMOVIE" type="tns:NikuDataBus"/>
<xsd:element name="WriteMOVIEResponse" type="tns:XOGOutput"/>
<xsd:element name="Auth">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="SessionID" type="xsd:string"/>
<xsd:element minOccurs="0" name="Username" type="xsd:string"/>
<xsd:element minOccurs="0" name="Password" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Login">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" name="Username" type="xsd:string"/>
<xsd:element minOccurs="0" name="Password" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="SessionID" type="xsd:string"/>
<xsd:element name="Logout">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="SessionID" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="ReadMOVIE">
<part element="tns:ReadMOVIE" name="body"/>
<part element="tns:Auth" name="header"/>
</message>
<message name="ReadMOVIEResponse">
<part element="tns:ReadMOVIEResponse" name="body"/>
</message>
<message name="WriteMOVIE">
<part element="tns:WriteMOVIE" name="body"/>
<part element="tns:Auth" name="header"/>
</message>
<message name="WriteMOVIEResponse">
<part element="tns:WriteMOVIEResponse" name="body"/>
</message>
<message name="Auth">
<part element="tns:Auth" name="header"/>
</message>
<message name="Login">
<part element="tns:Login" name="parameters"/>
</message>
<message name="LoginResponse">
<part element="tns:SessionID" name="body"/>
</message>
<message name="Logout">
<part element="tns:Logout" name="parameters"/>
</message>
<portType name="MoviesPort">
<operation name="ReadMOVIE">
<input message="tns:ReadMOVIE"/>
<output message="tns:ReadMOVIEResponse"/>
</operation>
<operation name="WriteMOVIE">
<input message="tns:WriteMOVIE"/>
<output message="tns:WriteMOVIEResponse"/>
</operation>
<operation name="Login">
<input message="tns:Login"/>
<output message="tns:LoginResponse"/>
</operation>
<operation name="Logout">
<input message="tns:Logout"/>
</operation>
</portType>
<binding name="MoviesSoapBinding" type="tns:MoviesPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="ReadMOVIE">
<soap peration soapAction="http://www.niku.com/xog/Object/ReadMOVIE" style="document"/>
<input>
<soap:body parts="body" use="literal"/>
<soap:header message="tns:Auth" part="header" use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="WriteMOVIE">
<soap peration soapAction="http://www.niku.com/xog/Object/WriteMOVIE" style="document"/>
<input>
<soap:body parts="body" use="literal"/>
<soap:header message="tns:Auth" part="header" use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="Login">
<soap peration soapAction="http://www.niku.com/xog/Object/Login" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="Logout">
<soap peration soapAction="http://www.niku.com/xog/Object/Logout" style="document"/>
<input>
<soap:body use="literal"/>
</input>
</operation>
</binding>
<service name="MoviesService">
<documentation>Clarity Object Request
Movies
Service
</documentation>
<port binding="tns:MoviesSoapBinding" name="MoviesService">
<soap:address location="http://localhost/niku/xog"/>
</port>
</service>
</definitions>

Any pointers will be of great help.

Thanks
Sravanthi
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 211
Buildfile: D:\home\karthik\TEST_WS_DOC_ELEMENT\build.xml
generate-client-stub:
[axis-wsdl2java] WSDL2Java D:\home\karthik\TEST_WS_DOC_ELEMENT\wsdl\Movie.wsdl
[axis-wsdl2java] Parsing XML file: D:\home\karthik\TEST_WS_DOC_ELEMENT\wsdl\Movie.wsdl
[axis-wsdl2java] Warning: Element {http://www.niku.com/xog/Object}SessionID has no type declaration, hence it is not a wrapper element. Switching off wrapped mode.
[axis-wsdl2java] Generating .\com\niku\www\xog\Object\Logout.java
[axis-wsdl2java] Generating .\com\niku\www\xog\Object\Auth.java
[axis-wsdl2java] Generating .\com\niku\www\xog\Object\NikuDataBus.java
[axis-wsdl2java] Generating .\com\niku\www\xog\Object\Login.java
[axis-wsdl2java] Generating .\com\niku\www\xog\Object\XOGOutput.java
[axis-wsdl2java] Generating .\com\niku\www\xog\Object\MoviesService.java
[axis-wsdl2java] Generating .\com\niku\www\xog\Object\MoviesServiceLocator.java
[axis-wsdl2java] Generating .\com\niku\www\xog\Object\MoviesPort.java
[axis-wsdl2java] Generating .\com\niku\www\xog\Object\MoviesSoapBindingStub.java

I was able to generate the source files.
Here is the build file i followed

<project name="SimpleService">
<property name="axis.home" value="D:\Apps\axis-1_4"/>
<path id="axis.classpath">
<fileset dir="${axis.home}/lib">
<include name="**/*.jar" />
</fileset>
</path>
<taskdef resource="axis-tasks.properties" classpathref="axis.classpath" />
<target name="generate-client-stub">
<axis-wsdl2javaurl="wsdl/Movie.wsdl" verbose="true">
</axis-wsdl2java>
</target>
</project>


SCJP 1.4 SCWCD 1.4 SCDJWS 1.4
sravant puto
Greenhorn

Joined: May 18, 2007
Posts: 4
Hi Karthik,

Thank you for the reply. I am new to web services and i was using eclipse plugins to generate WSDL2Java code. This is not working.

Can you please describe the steps I need to follow to generate code using ant scripts/command line

Thanks
Sravant
Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 211
http://forums.java.net/jive/thread.jspa?messageID=225040&tstart=0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Errors in WSDL2Java
 
Similar Threads
How to get Servcies,Input output xml formats from WSDL
How to access byte array web method
Cannot create service instance, service 'x' not found in wsdl
How to include Authrozitaion information in a WSDL file
Client stubs incorrect from wsdl using Axis