• Post Reply Bookmark Topic Watch Topic
  • New Topic

axis web services with complex data types

 
Ushan Adikaram
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!