aspose file tools
The moose likes Web Services and the fly likes axis web services with complex data types Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "axis web services with complex data types" Watch "axis web services with complex data types" New topic
Author

axis web services with complex data types

Ushan Adikaram
Greenhorn

Joined: Mar 29, 2009
Posts: 6
i developed a web service which can set and get customer information such as name, address, age etc. there i need to get the Address as an object it self which is a complex data type that include int homeNo, String streetAdd, String city. how to do this ? i developed my web service using jdk 1.5, axis 1.2.1 and tomcat 5.5.
narendra bandaru
Greenhorn

Joined: Oct 30, 2007
Posts: 1
Hi,

Create one more complex datatypes named as "addresses" and have the address complex data type as a type. And for addresses element use min and max occurs as o and infinity.

With this you can add address objects into this list and get extract the address objects when ever you need.

for ex/-

<xs:element name=addresses type=address minOccurs=0 maxOccurs=@>

<xs:complexType name="address">
<xs:sequence>
<xs:element name="address1" type="xs:string" minOccurs="1"/>
<xs:element name="address2" type="xs:string" minOccurs="0"/>
<xs:element name="city" type="xs:string" minOccurs="1"/>
<xs:element name="state" type="xs:string" minOccurs="1"/>
<xs:element name="zipcode" type="xs:string" minOccurs="1"/>
<xs:element name="country" type="xs:string" minOccurs="1"/>
</xs:sequence>
</xs:complexType>
Rizwan Patel
Ranch Hand

Joined: Jan 03, 2008
Posts: 59

i developed a web service which can set and get customer information such as name, address, age etc. there i need to get the Address as an object it self which is a complex data type that include int homeNo, String streetAdd, String city. how to do this ? i developed my web service using jdk 1.5, axis 1.2.1 and tomcat 5.5.


Hi Ushan, You can achieve this from same concept which we use in developing the component which returns the object, and once you create that service implementation axis will automatically gives you the wsdl for the same by java2wsdl utility. One more thing - At client side you have to handle the object return type for getting the required information.


scjp 1.5, OCPJWSD 5
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: axis web services with complex data types
 
Similar Threads
question about the cross-platform
Web service return complex data type vs. XML string
Reading external XML file from an Axis Web Service
Axis: Instantiating class with parameters
getting error while deployin service on SSL secured Server