Hi,
I have made promising processes in this area. The key is to follow the JAXWS
mapping rules to find or generate (I have added ASM-code generation)
corresponding RequestWrapper, ResponseWrapper and FaultBeanWrapper for a
give java method. With the wrappers in place, we don't have to handle
individual arguments. Instead, we use the JAXB context containing the
wrapper classes to generate the XSD in one shot.
Please see
https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/WrapperBeanGeneratorTestCase.
You'll find it very simple.
Thanks,
Raymond
--------------------------------------------------
From: "Simon Nash" <[EMAIL PROTECTED]>
Sent: Friday, May 30, 2008 2:37 PM
To: <[email protected]>
Subject: Re: Incorrect wsdl generated with ?wsdl for a service operation
with two dimensional String array parameter
Vamsavardhana Reddy wrote:
I have a service operation String[][] getGreetingsArray2(String[][]
names).
I am using interface.java in my service element in the composite. When
the
service uses a webservice binding, I get the following wsdl using ?wsdl
on
the endpoint url.
<wsdl:definitions ....>
<wsdl:types>
<xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="
http://jaxb.databindings.itest.sca.tuscany.apache.org/"
xmlns:ns0="http://util.java/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="getGreetingsArray2">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0"
name="arg0" nillable="true" type="xs:string"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getGreetingsArray2Response">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0"
name="return" nillable="true"
type="xs:string"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
...
</xs:schema>
</wsdl:types>
....
</wsdl:definitions>
Notice that the types correspond to String[] and not String[][].
I have added "@WebMethod public String[][] getGreetingsArray2(String[][]
names)" to MyServiceImpl class in sca\modules\interface-java-jaxws and
used
jaxws-maven-plugin to generate the wsdl.
MyServiceImplService.wsdl has
<types>
<xsd:schema>
<xsd:import namespace="
http://jaxws.java.interfacedef.sca.tuscany.apache.org/"
schemaLocation="MyServiceImplService_schema1.xsd"/>
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://jaxb.dev.java.net/array"
schemaLocation="MyServiceImplService_schema2.xsd"/>
</xsd:schema>
</types>
MyServiceImplService_schema2.xsd has
<xs:complexType name="stringArray" final="#all">
<xs:sequence>
<xs:element name="item" type="xs:string" minOccurs="0"
maxOccurs="unbounded" nillable="true"/>
</xs:sequence>
</xs:complexType>
MyServiceImplService_schema1.xsd has
<xs:complexType name="getGreetingsArray2">
<xs:sequence>
<xs:element name="arg0" type="ns1:stringArray" nillable="true"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getGreetingsArray2Response">
<xs:sequence>
<xs:element name="return" type="ns1:stringArray" nillable="true"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
In other words jaxws-maven-plugin seems to generate proper types for
String[][].
There seems to be a problem with the code that generates wsdl when ?wsdl
is
used on the endpoint url.
++Vamsi
This support is not yet implemented in the new runtime Java2WSDL
mapping code. Please open a JIRA for this and I will look at it.
Thanks.
Simon