I have noticed an inconsistency in the encoding of arrays by Axis Java
clients (created using WSDL2Java) and AxisCPP clients (created using
WSDL2Ws), and I was hoping someone could give me some advice.

In short, I have the following RPC/encoded WSDL snippet that defines the
array:

  <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://localhost/axis/csaapi/xsd";>
      <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
      <complexType name="ArrayOfInt">
        <complexContent>
            <restriction base="soapenc:Array">
              <attribute ref="soapenc:arrayType"
wsdl:arrayType="int[]"/>
            </restriction>
        </complexContent>
      </complexType>
    </schema>
  </types>

When I create and run the AxisCPP client, it generates XML that uses
"<item>" to denote the elements in the array:

  <SOAP-ENV:Body>
    <ns1:GetNamesByIds
        xmlns:ns1="http://localhost/axis/csaapi";>
      <objType xsi:type="xsd:int">0</objType>
      <idsArray
          xmlns:enc="http://www.w3.org/2001/06/soap-encoding";
          enc:arrayType="xsd:int[9]">
        <item>1</item>
        <item>2</item>
        <item>3</item>
      </idsArray>
    </ns1:GetNamesByIds>
  </SOAP-ENV:Body>

My AxisCPP service handles this just fine.

BUT, my Java client generates XML that doesn't use the "<item>"
construct, and it causes my CPP service to fail to parse the data.
Here's the Java XML:

  <soapenv:Body>
    <ns1:GetNamesByIds
 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
        xmlns:ns1="http://localhost/axis/csaapi";>
      <objType xsi:type="xsd:int">0</objType>
      <ids soapenc:arrayType="xsd:int[9]"
            xsi:type="soapenc:Array"
            xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";>
        <ids xsi:type="xsd:int">1</ids>
        <ids xsi:type="xsd:int">2</ids>
        <ids xsi:type="xsd:int">3</ids>
      </ids>
    </ns1:GetNamesByIds>
  </soapenv:Body>

Could someone give me advice on the best way to handle this?  Note that
I've already turned the MULTIREF option off to fix a different set of
problems.  I'd prefer to keep the RPC/Encoded style if at all possible.

Thank you very much in advance!

-Jonathan Beakley
[EMAIL PROTECTED]

Reply via email to