users@jaxb.java.net

Re: how to write a xsd that mapping to java.util.Map

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 14 May 2007 17:16:18 -0700

XJC currently never generates Map, so what you are asking cannot be done
today. That said, I agree that this is useful.

There might be an RFE filed for this.

santa T wrote:
> I am devoloping a webservice application using jax-ws2.1
>
> I want write a wsdl and xsd file which applyed the follow function
>
> public void addElement(String id,Map<String,String> repos){
> .................
> }
>
> relevant snippet of wsdl
> <message name="addElement">
> <part name="parameters" element="tns:addElement"></part>
> </message>
> <portType name="...">
> ........
> <operation name="addElement">
> <input message="tns:addElement"></input>
> <output message="tns:addElementResponse"></output>
> </operation>
>
> relevant snippet of xsd.
> <xs:element name="addElement" type="tns:addElement"></
> xs:element>
> <xs:complexType name="addElement">
> <xs:sequence>
> <xs:element name="id" type="xs:string"
> minOccurs="0"></xs:element>
> <xs:element name="repos" type="xs:Map???"
> minOccurs="0"></
> xs:element>
> ------------------------------------------------------------------------------------------------
>
> </xs:sequence>
> </xs:complexType>
>
> my question is what type does repos should be?? "xs:Map" is wrong as
> i know.
> Thanks.
>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com