Hi,
It's well-known issue you need to have something like that:
1) wsdl part:
<complexType name="exampleType">
<sequence>
 <element maxOccurs="unbound" minOccurs="0" name="f1stArr"
type="ns:DataType1"
</sequence>
2) Java side:
public DataType1[] getF1stArr() {
...
}
public void setF1stArr(DataType1[] d) {
.....
}
public DataType1 getF1stArr(int i) {
return arr[i];
}
public void setF1stArr(int i, DataType1 dt) {
arr[i] = dt;
}

Last two methods is requires for .NET interroperobility. If you haven't them
in the you bean than you will have your wsdl in that way:

<complexType name="ReturnType">

   <sequence>

     <element name="myArray" nillable="true" type="impl:ArrayOfMyArrayType
"/>

  </sequence>

</complexType>

<complexType name="ArrayOfMyArrayType">

   <sequence>

     <element maxOccurs="unbounded" minOccurs="0" name="item"
type="impl:ArrayType"/>

   </sequence>

</complexType>
Just add these two methods and correct your wsdl and be happy with .NET :-)

2007/1/19, Chris Harris <[EMAIL PROTECTED]>:

 Hi all,



We currently have a java application that provides a number of axis web
services that are rpc/encoded and have be recently experiencing problems
with integrating into web services client tools such as Biztalk. The cause
of our problem was around the encoding of arrays. In order to be WS-I
compliant we now expose wrapped/literal web services.



This has worked perfectly when the client application is using Axis but
there is an interoperability problem when the client is a .net application.
The problem only occurs when you returning an object that has an array of
other objects. I hope the following environment explanation helps you
understand the problem:



Axis generated the following XML schema of the return object (I have only
included the return object definition).





<complexType name="ReturnType">

    <sequence>

      <element name="myArray" nillable="true"
type="impl:ArrayOfMyArrayType "/>

   </sequence>

</complexType>



<complexType name="ArrayOfMyArrayType">

    <sequence>

      <element maxOccurs="unbounded" minOccurs="0" name="item"
type="impl:ArrayType"/>

    </sequence>

</complexType>



<complexType name=" ArrayType ">

    <sequence>

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

   </sequence>

</complexType>





The response message generated by axis looks like:



<soapenv:Body>

         <myMethodResponse xmlns="http://test ">

            <myMethodReturn>

               <myArray>

                  <myArray>

                     <channelId>2</channelId>

                 </myArray>

             </myArray>

          </myMethodReturn>

      </myMethodResponse>

</soapenv:Body>





The problem is that there are nested myArray element when the xml schema
within the WSDL defines that there should be an item element. For some
reason an axis client will accept this odd nesting of elements but a .net
client always reports that the array is empty.



Does anyone know of a way of making the response message look like:



<soapenv:Body>

         <myMethodResponse xmlns="http://test ">

            <myMethodReturn>

               <myArray>

                  <item>

                     <channelId>2</channelId>

                 </item>

             </myArray>

          </myMethodReturn>

      </myMethodResponse>

</soapenv:Body>



Many Thanks,



Chris
















--
Thanks,
Yura.

Reply via email to