You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Julien Coloos (JIRA)" <ax...@ws.apache.org> on 2005/04/12 10:50:27 UTC

[jira] Commented: (AXIS-1897) Axis 1.2RC3 and .NET 1.1: Problem with EchoMap

     [ http://issues.apache.org/jira/browse/AXIS-1897?page=comments#action_62632 ]
     
Julien Coloos commented on AXIS-1897:
-------------------------------------

I encountered a similar problem with a WebMethods client when dealing with a Map object.

A snippet of my WSDL (generated by Java2WSDL) :

...
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xml.apache.org/xml-soap">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="mapItem">
    <sequence>
     <element name="key" nillable="true" type="xsd:string"/>
     <element name="value" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <complexType name="Map">
    <sequence>
     <element name="item" minOccurs="0" maxOccurs="unbounded" type="apachesoap:mapItem"/>
    </sequence>
   </complexType>
  </schema>
...

Doing some further testing (sending RAW requests to the WebService) seemed to show that the problem was WebMethods (and here .NET too) using a tag named 'item' inside the Map, but actually being an Array :

(snippet of WebMethods requests)
...
          <data xsi:type="sc2:Map" xmlns:sc2="http://xml.apache.org/xml-soap" id="id2">
            <item xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="sc2:mapItem[1]" id="id3">
              <item xsi:type="sc2:mapItem" id="id4">
                <key xsi:type="xsd:string">1</key>
                <value xsi:type="xsd:string">1</value>
              </item>
            </item>
          </data>
...

(with your .NET client)
...
    <q1:Map id="id1" xsi:type="q1:Map" xmlns:q1="http://xml.apache.org/xml-soap">
      <item href="#id2"/>
    </q1:Map>
    <soapenc:Array id="id2" soapenc:arrayType="q2:mapItem[2]" xmlns:q2="http://xml.apache.org/xml-soap">
      <Item href="#id3"/>
      <Item href="#id4"/>
    </soapenc:Array>
...


Using the same request WebMethods was sending, but replacing the parent 'item' tagname (the one being said to be a SOAP-ENC:Array) by something else (any other name), the WebServer replied the expected answer ...

Maybe the Map deserializer assumes that any child tag named 'item' will be a mapItem (as defined in the WSDL ... even if this tag is said to be of another type - SOAP-ENC:Array here) ?

> Axis 1.2RC3 and .NET 1.1: Problem with EchoMap
> ----------------------------------------------
>
>          Key: AXIS-1897
>          URL: http://issues.apache.org/jira/browse/AXIS-1897
>      Project: Axis
>         Type: Bug
>   Components: Samples, Serialization/Deserialization
>     Versions: 1.2RC3
>  Environment: Windows 2000 + Service Pack 4; Java JDK 5.0 version 1.5.0_02; .NET 1.1
>     Reporter: Chris White

>
> Calling the echoMap method on the sample EchoService returns the following error in the .NET client application:
> "System.Web.Services.Protocols.SoapException: org.xml.sax.SAXException: No deserializer for {http://xml.apache.org/xml-soap}mapItem"
> The code snippet from the .NET client:
>             Console.WriteLine("Calling echoMap");
>             Map inMap = new Map();
>             inMap.item = new mapItem[2]
>             {
>                new mapItem(), 
>                new mapItem()
>             };
>             inMap.item[0].key = "Microsoft";
>             inMap.item[0].value = ".NET";
>             inMap.item[1].key = "Sun";
>             inMap.item[1].value = "Java";
>             Map outMap = echoService.echoMap(inMap);
>             Console.WriteLine("echoMap response");
>             mapItem[] items = outMap.item;
>             foreach (mapItem mapItem in items)
>             {
>                 Console.WriteLine(mapItem.key + "=" + mapItem.value);
>             }
> Running the SOAPMonitor showed that Axis received the SOAP request, but there was no corresponding response displayed for that request.  The request displayed in the SOAPMonitor is: 
> <?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:types="http://soapinterop.org/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>   <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>     <tns:echoMap>
>       <input href="#id1"/>
>     </tns:echoMap>
>     <q1:Map id="id1" xsi:type="q1:Map" xmlns:q1="http://xml.apache.org/xml-soap">
>       <item href="#id2"/>
>     </q1:Map>
>     <soapenc:Array id="id2" soapenc:arrayType="q2:mapItem[2]" xmlns:q2="http://xml.apache.org/xml-soap">
>       <Item href="#id3"/>
>       <Item href="#id4"/>
>     </soapenc:Array>
>     <q3:mapItem id="id3" xsi:type="q3:mapItem" xmlns:q3="http://xml.apache.org/xml-soap">
>       <key xsi:type="xsd:string">Microsoft</key>
>       <value xsi:type="xsd:string">.NET</value>
>     </q3:mapItem>
>     <q4:mapItem id="id4" xsi:type="q4:mapItem" xmlns:q4="http://xml.apache.org/xml-soap">
>       <key xsi:type="xsd:string">Sun</key>
>       <value xsi:type="xsd:string">Java</value>
>     </q4:mapItem>
>   </soap:Body>
> </soap:Envelope>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira