users@jax-rpc.java.net

Parsing Complex Datatypes

From: Sudhir <sudhir_at_INFOLEAD.COM>
Date: Fri, 03 May 2002 16:19:18 -0700

Hi,
 I am trying to parse a given WSDL and generate the clients on the fly. I am
able to do that for WSDL's with simple data types. I want to know how do I
go about parsing the complex data types. Any help/suggestions/existing code
samples would be very helpful to me.

Thanks
Sudhir

----- Original Message -----
From: "Sapozhnikov Michael" <msapozhnikov_at_AXSONE.COM>
To: <JAXRPC-INTEREST_at_JAVA.SUN.COM>
Sent: Friday, May 03, 2002 12:14 PM
Subject: Extension of complex types


> Hi,
> I have problems with extesion of complex type:
>
> <complexType name="UserContextType">
> <sequence>
> <element name="SYS_USER" minOccurs="0" type="string"/>
> <element name="GROUP_ID" minOccurs="0" type="string"/>
> <element name="DBMAP" minOccurs="0" type="string"/>
> <element name="ENTITY" type="string" minOccurs="0"/>
> </sequence>
> </complexType>
>
> <!-- this does not work -->
> <complexType name="UserRequestType">
> <complexContent>
> <extension base="tns:UserContextType">
> <sequence>
> <element name="HOST_USER" type="string" minOccurs="0"/>
> <element name="HOST_PWD" type="string" minOccurs="0"/>
> </sequence>
> </extension>
> </complexContent>
> </complexType>
>
> <!-- below works, but I need to reuse types -->
>
> <complexType name="UserRequestType">
> <sequence>
> <element name="SYS_USER" minOccurs="0" type="string"/>
> <element name="GROUP_ID" minOccurs="0" type="string"/>
> <element name="DBMAP" minOccurs="0" type="string"/>
> <element name="ENTITY" type="string" minOccurs="0"/>
> <element name="HOST_USER" type="string" minOccurs="0"/>
> <element name="HOST_PWD" type="string" minOccurs="0"/>
> </sequence>
> </complexType>
>
> I read spec and it says (Appendix: XML Schema support) that derivation of
complex Types by extension is required in JAX-RPC 1.0.
> My example matches example provided for complex type "Address" and its
extension "USAddress", but it does not work. Is something wrong in my code
or this is just a bug in RI?
>
> BTW, example provided uses unsupported type: zip element in USAddress is
defined as
> <element name="zip" type="positiveInteger"/>
> but positiveInteger is not a supported XML type.
>
> This brings me to another question:
> How to use positiveInteger, NonNegativeInteger, etc if
> derivation of new simple types by restriction of an existing simple type
is optional and derivation of complex type from a simple type is also
optional (and as a matter of fact they are not implemented in RI)?
>
> What is a suggested way of implementing these types, or we just have to
avoid them until they will be implemented?
>
> Any help greatly appreciated.
>
> Thanks,
> Michael
>