I believe this relates to a problem I am having as well. The array is not being wrapped with another element in the response.
In addition there is another problem in that the wsdl that is generated for the array wrapper schema names the element "item" and if you have more than 1 array wrapper in the same schema then you have 2 elements with the name "item" and .NET apparently doesn't like this. If you look at the code you pointed out below it will create a wrapper element with sub elements all named "item" this matches what happens during the rpc/encoded processing but I don't believe it is valid for the wrapped/literal processing. marcus -----Original Message----- From: Eric Chijioke [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 22, 2004 11:46 AM To: [EMAIL PROTECTED] Subject: RE: Axis and .NET interoperability - Arrays My WSDL (and schema) was generated manually. I am including my WSDL schema definitions below. The problem doesn't seem to be with the WSDL, because the client (.NET) consuming it produces the correct 'wrappered' array, which Axis deserializes fine. The problem occurs when Axis attempts to serialize a response with an array using document/literal (wrapped). Under these conditions, it doesn't place a wrapper element around the array items. I've located the following code in the org.apache.axis.encoding.ser.ArraySerializer class: ------------ begin snippet --------------- if (!maxOccursUsage) { serializeAttr = null; // since we are putting them here context.startElement(name, attributes); elementName = Constants.QNAME_LITERAL_ITEM; } ------------ end snippet ----------------- With the corresponding serialization of a closing wrapper later on: ------------ begin snippet --------------- if (!maxOccursUsage) context.endElement(); ------------ end snippet ----------------- This indicates that Axis only includes the wrapper element when the array is described using the soapenc:Array (Non WS-I compliant) syntax. Commenting out the conditionality for these statements seems to result in the proper wrapped serialization. I am including the relevant schema definitions from my WSDL. I am also including the parameter elements from the method ( getFactors() ) which is serializing incorrectly - The getFactorResponse() element doesn wrapper the individual <factor> elements in an <wrapper> element. ------------------ WSDL schema fragments --------------- <element name="getFactors"> <complexType> <sequence> <element minOccurs="1" maxOccurs="1" name="ids" type="intf:stringArray"/> </sequence> </complexType> </element> <element name="getFactorsResponse"> <complexType> <sequence> <element minOccurs="1" maxOccurs="1" name="factors" type="intf:FactorArray"/> </sequence> </complexType> </element> <complexType name="stringArray"> <sequence> <element name="element" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> <complexType name="Factor"> <sequence> <element name="id" type="xsd:string"/> <element name="name" type="xsd:string"/> <element name="correlation" type="xsd:double"/> <element name="mean" type="xsd:double"/> <element name="variance" type="xsd:double"/> <element name="covariance" type="xsd:double"/> <element name="capital" type="xsd:double"/> <element name="systematicContribution" type="xsd:double"/> <element name="idiosyncraticContribution" type="xsd:double"/> <element name="contribution" type="xsd:double"/> <element name="maximum" type="xsd:double"/> <element name="reinsurers" type="intf:ReinsurerArray"/> </sequence> </complexType> <complexType name="FactorArray"> <sequence> <element name="factor" type="intf:Factor" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> <complexType name="Reinsurer"> <sequence> <element name="correlation" type="xsd:double"/> <element name="probability" type="xsd:double"/> <element name="amount" type="xsd:double"/> <element name="contribution" type="xsd:double"/> </sequence> </complexType> <complexType name="ReinsurerArray"> <sequence> <element name="item" type="intf:Reinsurer" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> Thanks, Eric -----Original Message----- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 22, 2004 1:06 PM To: [EMAIL PROTECTED] Subject: RE: Axis and .NET interoperability - Arrays According to the WS-I Basic Profile [1] (see Section 4.3.3) Given the XML Schema Description: <xsd:element name="MyArray1" type="tns:MyArray1Type"/> <xsd:complexType name="MyArray1Type"> <xsd:sequence> <xsd:element name="x" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> The envelope would serialize as (omitting namespace declarations for clarity): <MyArray1> <x>abcd</x> <x>efgh</x> </MyArray1> Note that this is the proper way to define an array using document literal. This type of definition should generate a wrapper (<MyArray1>) for the array elements (<x>). If you have defined your array this way, but it does not generate the <MyArray1> wrapper element, then there's obviously a bug. Nested arrays work pretty much the same way -- there should always be a wrapper element for the array elements. Given the XML Schema Description: <xsd:element name="MyArray1" type="tns:MyArray1Type"/> <xsd:complexType name="MyArray1Type"> <xsd:sequence> <xsd:element name="MyArray2" type="tns:MyArray2Type" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="MyArray2Type"> <xsd:sequence> <xsd:element name="x" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> The envelope would serialize as (omitting namespace declarations for clarity): <MyArray1> <MyArray2> <x>abcd</x> <x>efgh</x> </MyArray2> <MyArray2> <x>ijkl</x> <x>mnop</x> </MyArray2> </MyArray1> I suspect that the interop problems may be caused by the way the Schema definitions are generated. Can you provide us with the generated XML Schema definitions of the nested arrays? [1] http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#soapenc_Ar ray - Anne -----Original Message----- From: Eric Chijioke [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 22, 2004 12:00 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Axis and .NET interoperability - Arrays I hesitate to file a bug, because I'm still not sure which array serialization scheme is correct (.NET or Axis). .NET wrappers the array elements in a container element, whereas Axis places them directly within the envelope's body root "method" element. -----Original Message----- From: Davanum Srinivas [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 2:52 PM To: [EMAIL PROTECTED] Cc: Thiele, Michael (LDS) Subject: Re: Axis and .NET interoperability - Arrays Guys, unless there is a bug report with a reproducible test case....we can't help you. -- dims On Tue, 14 Sep 2004 09:54:30 -0400, Eric Chijioke <[EMAIL PROTECTED]> wrote: > Thanks Michael, > This is very useful. > > You found that .NET 1.1 doc/literal doesn't work with Axis 1.2 Beta 3 > for complex objects, object arrays etc.. > How did they fail to interop in your tests? > I found that .NET wrappers arrays of complex objects with a container > element, whereas Axis simply serializes the array elements directly > inside the operation node (child node of soap body element), could you > corroborate this? > > Which is correct? (I don't see a directive in the spec anywhere) > > Thanks, > Eric > > -----Original Message----- > From: Thiele, Michael (LDS) [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 14, 2004 3:33 AM > To: [EMAIL PROTECTED] > Cc: Eric Chijioke > Subject: AW: Axis and .NET interoperability - Arrays > > Eric, > > we could not find sufficient information about interoperability in > detail and checked out those issues with Axis and .NET on our own. > Here is a list of out _primarily_ results. If we have some more time > we will publish testcases and bugreports... > > HTH. > > Please use a monospaced font to view the matrix > > Server: > Apache Axis 1.2 Beta 3 > > Clients: > Microsoft .NET 1.1 RPC/encoded------------| Microsoft .NET 1.1 > Doc/literal(wrapped)-| | Apache Axis 1.2 Beta 3 Doc/literal----| | | > Apache Axis 1.2 Beta 3 RPC/encoded--| | | | Apache Axis 1.1 final > RPC/encoded-| | | | | > | | | | | > Datatypes: | | | | | > Simple Datatypes..................x.x.x.x.x > String Arrays.....................x.x.x.x.- > Complex Objects...................x.x.x.-.x > Object Arrays.....................x.x.x.-.x > Complex Object w/.................x.x.x.-.x nested Object Arrays.. > Complex Objects w/................x.x.x.-.x nested Object w/ nested > Object Arrays > > Server: > Apache Axis 1.1 final > > Clients: > Microsoft .NET 1.1 RPC/encoded------------| Microsoft .NET 1.1 > Doc/literal(wrapped)-| | Apache Axis 1.2 Beta 3 Doc/literal----| | | > Apache Axis 1.2 Beta 3 RPC/encoded--| | | | Apache Axis 1.1 final > RPC/encoded-| | | | | > | | | | | > Datatypes: | | | | | > Simple Datatypes..................x.x.o.o.x > String Arrays.....................x.x.o.o.x > Complex Objects...................x.x.o.o.x > Object Arrays.....................x.x.o.o.x > Complex Object w/.................x.x.o.o.x nested Object Arrays.. > Complex Objects w/................x.x.o.o.x nested Object w/ nested > Object Arrays > > ------------------- > o: not tested > x: tested, works > -: tested, does not work > > Note 1: Of course, we changed the style (RPC/encoded, Doc/literal) on > the server side first and generated new stubs for each client. > Note 2: You have to transfer data to test interoperability. Only > validataing if stubs can be generated is not sufficient. > Note 3: There is no difference in interoperability if you are using > .NET > 1.1 with or without .NET Service Pack 1 and with or without Microsoft > WS Enhancements. > Note 4: There were no differences regarding this issues using > Doc/literal or Doc/wrapped in Axis 1.2 Beta 3 Note 5: Simple Datatypes: > int, Integer, double, Double, String, > java.util.Calendar(!) etc.; Complex Objects: like Address or so.; > Object Arrays like Address[]; Complex Object w/ nested Object Arrays > like Person with nested Address[]; > > As a result we cannot recommend using Doc/literal at this time if one > client is using .NET. > > Best regards > > Mummert Consulting AG > > Michael Thiele > Senior Consultant > Integrated Business Consulting > > Neue Weyerstr. 6 > D-50676 Koeln > > Tel: +49 221 92404-6130 > Fax: +49 221 92404-6199 > Mob: +49 178 6612185 > Mailto: [EMAIL PROTECTED] http://www.mummert-consulting.de > > LDS-NRW > Mauerstr. 51, Raum 9.27 > 40476 Duesseldorf > Mailto:[EMAIL PROTECTED] > Durchwahl: +49 211 9449-2455 > > -----Ursprungliche Nachricht----- > Von: Eric Chijioke [mailto:[EMAIL PROTECTED] > Gesendet: Donnerstag, 9. September 2004 18:03 > An: [EMAIL PROTECTED] > Betreff: Axis and .NET interoperability - Arrays > > I have read a LOT of discussions concerning problems serializing and > deserializing arrays between an Axis server and a .NET client but > can't seem to find any definitive discussion/document. Is there one? > > Secondly, > > [...] > > Thanks > > Eric Chijioke > [EMAIL PROTECTED] > > -- Davanum Srinivas - http://webservices.apache.org/~dims/