You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Chen, Li Ye (Research)" <ch...@research.ge.com> on 2004/06/14 17:26:59 UTC

Naming the returned values from Apache Axis server

Hi All,
	Currently we have this server-side web service that uses Axis to
return a double-array of String values:

public static String[][] myMethod(<some params>) throws AxisFault { ... }

which Axis serializes as something like

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
 <soapenv:Body>
  <ns1:myMethodResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="myMeth">
   <ns1:myMethodReturn xsi:type="soapenc:Array"
soapenc:arrayType="ns2:string[][1]"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://www.w3.org/2001/XMLSchema">
    <item soapenc:arrayType="ns2:string[4]">
        <item>foo</item>
        <item>bar</item>
        <item>123</item>
        <item>gee</item>
    </item>
   </ns1:myMethodReturn>
  </ns1:myMethodResponse>
 </soapenv:Body>
</soapenv:Envelope>

How do I change the Axis serialization process so that instead of item,
item, item..., it displays something like:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
 <soapenv:Body>
  <ns1:myMethodResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="myMeth">
   <ns1:myMethodReturn xsi:type="soapenc:Array"
soapenc:arrayType="ns2:string[][1]"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://www.w3.org/2001/XMLSchema">
    <item soapenc:arrayType="ns2:string[4]">
        <myFirstItem>foo</myFirstItem>
        <hereIsAnother>bar</hereIsAnother>
        <yetAnother>123</yetAnother>
        <lastItem>gee</lastItem>
    </item>
   </ns1:myMethodReturn>
  </ns1:myMethodResponse>
 </soapenv:Body>
</soapenv:Envelope>

?

Thanks,