| 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
|
 |
 |
|
|
subject: axis web services with complex data types
|
|
|