I used this approach to get arround creation of ArrayOf* classes, but have another problem that I want to avoid. The wsdl2java emits a bunch of classes starting with _ e.g. from the following wsdl schema snippet

---------

<element name="acquireTask">
    <complexType>
     <sequence>
      <element name="in0" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="acquireTaskResponse">
    <complexType/>
   </element>

......

<wsdl:message name="acquireTaskRequest">
      <wsdl:part name="parameters" element="impl:acquireTask"/>
   </wsdl:message>

.....

      <wsdl:operation name="acquireTask">
         <wsdl:input name="acquireTaskRequest" message="impl:acquireTaskRequest"/>
         <wsdl:output name="acquireTaskResponse" message="impl:acquireTaskResponse"/>
         <wsdl:fault name="somefault" message="impl:SomeFault"/>

....

------

The following class is generated:

public class _acquireTask  implements java.io.Serializable {
    private java.lang.String in0;

    public _acquireTask() {
    }

    public _acquireTask(
           java.lang.String in0) {
           this.in0 = in0;
    }

.....

 

Any ideas how to avoid this? The original interface is:

public void acquireTask(String taskId)   throws RemoteException,....

and I am using a java2wsdl (with wrapped option) and then a wsdl2java to generate the stubs. I want to avoid creation of artifacts like _acquireTask.java etc.

Thanks for any pointers,

Shantanu Sen

 

-----Original Message-----

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]

Sent: Friday, November 19, 2004 9:05 AM

To: [EMAIL PROTECTED]

Subject: RE: Bug about array of beans in 1.2RC2 (wrapped/literal)

I have encountered this same situation with .NET. To fix the problem we had to make the array property a Java Bean Indexed Property. Your ArrayBean needs to have not only the simple getter and setter from simpleBeanArrayData but also a getter and setter by index, getSimpleBeanArrayData(int i) and setSimpleBeanArrayData(int i, SimpleBean bean).

This keeps Axis from generating the ArrayOf_ type (which is not valid based on the WS-I spec).

-----Original Message-----

From: WAJSBERG Julien RD-BIZZ [mailto:[EMAIL PROTECTED]]

Sent: Friday, November 19, 2004 1:16 AM

To: [EMAIL PROTECTED]

Subject: Bug about array of beans in 1.2RC2 (wrapped/literal)

 

Hi,

We have a strange bug in axis 1.2RC2, dealing with array of beans.

There is a method whose signature is :

public ArrayBean echoArrayBean(ArrayBean param);

ArrayBean is defined like this :

public class ArrayBean implements Serializable {

private String stringData;

private SimpleBean[] simpleBeanArrayData;

... accessors ...

}

And SimpleBean :

public class SimpleBean implements Serializable {

private String stringData;

private int intData;

... accessors ...

}

The corresponding part of the WSDL generated by Axis follows (in

different namespaces, but we don't care here) :

<element name="echoArrayBean">

<complexType>

<sequence>

<element name="in0" type="tns1:ArrayBean"/>

</sequence>

</complexType>

</element>

<complexType name="ArrayOf_tns1_SimpleBean">

<sequence>

<element maxOccurs="unbounded" minOccurs="0" name="item"

type="tns1:SimpleBean"/>

</sequence>

</complexType>

<complexType name="SimpleBean">

<sequence>

<element name="intData" type="xsd:int"/>

<element name="stringData" nillable="true" type="xsd:string"/>

</sequence>

</complexType>

<complexType name="ArrayBean">

<sequence>

<element name="simpleBeanArrayData" nillable="true"

type="impl:ArrayOf_tns1_SimpleBean"/>

<element name="stringData" nillable="true" type="xsd:string"/>

</sequence>

</complexType>

What's important here is that "item" is correctly specified as an

element of Array_Of_tns1_SimpleBean.

When I try to invoke this operation with a Weblogic client, I get the

following exception :

java.rmi.RemoteException: SOAP

Fault:javax.xml.rpc.soap.SOAPFaultException: org.xml.sax.SAXException:

Invalid element in com.francetelecom.clara.ws2.bean.SimpleBean - item

The corresponding part in the soap message is :

<n1:echoArrayBean><n1:in0><n2:simpleBeanArrayData

xsi:type="n1:ArrayOf_tns1_SimpleBean">

<n1:item

xsi:type="n2:SimpleBean"><n2:intData>-123456</n2:intData><n2:stringData>ces

données sontcomplexes [EMAIL PROTECTED]</n2:stringData></n1:item>

<n1:item

xsi:type="n2:SimpleBean"><n2:intData>-123456</n2:intData><n2:stringData>ces

données sontcomplexes [EMAIL PROTECTED]</n2:stringData></n1:item>

</n2:simpleBeanArrayData><n3:stringData>data</n3:stringData></n1:in0></n1:ec

hoArrayBean>

This message seems to be correct, according to the WSDL. Yet, Axis

doesn't like it :/

Note : we just tried with an Axis client: same behaviour.

--

Julien Wajsberg

Reply via email to