Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Complex Type creating problem  RSS feed

 
Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am creating a web service in which I have to use ComplexType but wsdl2java utility is not generatig all the classes for Complex Type
Wsdl file is given below

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="ProductService"
targetNamespace="http://www.ecerami.com/wsdl/ProductService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.ecerami.com/wsdl/ProductService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd1="http://www.ecerami.com/schema">

<types>
<xsd:schema
targetNamespace="http://www.ecerami.com/schema"
xmlns="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="product">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="price" type="xsd ouble"/>
<xsd:element name="SKU" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>

<message name="getProductRequest">
<part name="sku" type="xsd:string"/>
</message>

<message name="getProductResponse">
<part name="product" type="xsd1 roduct"/>
</message>

<portType name="Product_PortType">
<operation name="getProduct">
<input message="tns:getProductRequest"/>
<output message="tns:getProductResponse"/>
</operation>
</portType>

<binding name="Product_Binding" type="tns roduct_PortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getProduct">
<soap peration soapAction="urn:examples roductservice"/>
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples roductservice"
use="encoded"/>
</input>
<output>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples roductservice" use="encoded"/>
</output>
</operation>
</binding>

<service name="Product_Service">
<port name="Product_Port" binding="tns roduct_Binding">
<soap:address location="http://localhost:8080/soap/servlet/rpcrouter"/>
</port>
</service>
</definitions>


Ant Script for generating Jav file from wsdl

<java fork="true" classname="org.apache.axis2.wsdl.WSDL2Java" classpathref="gen.classpath"
<arg line="-g -ss -sd -uri ${service.wsdl} -o ${work.dir} -p com.abc.zp"/>
</java>


Ant Script Out Put

[java] - Jalopy not found - unable to pretty print ..\temp\src\com\ecerami\www\wsdl\productservice_wsdl\GetProductResponse.java
[java] - Jalopy not found - unable to pretty print ..\temp\src\com\ecerami\www\wsdl\productservice_wsdl\GetProductRequest.java
[java] - Jalopy not found - unable to pretty print ..\temp\src\com\ecerami\www\wsdl\productservice_wsdl\GetProductResponse0.java
[java] - Jalopy not found - unable to pretty print ..\temp\src\com\ecerami\www\wsdl\productservice_wsdl\GetProduct.java
[java] - Jalopy not found - unable to pretty print ..\temp\src\com\alu\zp\soap\Product_ServiceSkeleton.java
[java] - Jalopy not found - unable to pretty print ..\temp\src\com\alu\zp\soap\Product_ServiceMessageReceiverInOut.java
[java] - Jalopy not found - unable to pretty print ..\temp\src\com\alu\zp\soap\Product_ServiceCallbackHandler.java
[java] - Jalopy not found - unable to pretty print ..\temp\src\com\alu\zp\soap\Product_ServiceStub.java
[java] - Jalopy not found - unable to pretty print ..\temp\test\com\alu\zp\soap\Product_ServiceTest.java



Thanks
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be some mismatch in the input wsdl generated.
If you are interested you can read this article which explains about using complex types webservices http://radio.javaranch.com/balajidl/2006/03/22/1143041392434.html
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is that you do not have jalopy jar in your classpath. It is an open source utility to format code. This is the site from where you can download the binaries, if you do not have it already.
 
Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for quick Response but problem is that Java files are not generating agianst the given Complex Type
Thakns
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vijay Kumar:
Thanks for quick Response but problem is that Java files are not generating agianst the given Complex Type
Thakns


Do you have jalopy in the classpath?
Jalopy is used to generate the java files only.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!