You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Michael Reardon <mi...@onewebsystems.com> on 2001/04/11 20:20:38 UTC

Custom serializer problems

Hi,
I've written a custom serializer based on the Hashtable serializer. I
use it in an RPC service that generates output which looks somthing like
this...

<SOAP-ENV:Body>
   <ns1:getByIDResponse xmlns:ns1="urn:test-product-provider" 
                       
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
     <return xsi:type="SOAP-ENV:Parameter">
        <item>
          <key xsi:type="xsd:string">Name</key>
          <value xsi:type="xsd:string">Barbie</value>
        </item>
        <item>
          <key xsi:type="xsd:string">PartNum</key>
          <value xsi:type="xsd:string">a12322</value>
        </item>
        <item>
          <key xsi:type="xsd:string">Price</key>
          <value xsi:type="xsd:double">13.0</value>
        </item>
        <item>
          <key xsi:type="xsd:string">Color</key>
          <value xsi:type="xsd:ur-type" xsi:null="true"/>
        </item>
        <item>
           <key xsi:type="xsd:string">Description</key>
           <value xsi:type="xsd:ur-type" xsi:null="true"/>
        </item>
     </return>
   </ns1:getByIDResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

However, this gives my simple test client a fit, causing a stack
overflow:

java.lang.StackOverflowError
        at
org.apache.xerces.dom.NamedNodeMapImpl.findNamePoint(NamedNodeMapImpl.java:511)
        at
org.apache.xerces.dom.NamedNodeMapImpl.getNamedItemNS(NamedNodeMapImpl.java:185)
        at
org.apache.xerces.dom.ElementImpl.getAttributeNodeNS(ElementImpl.java:657)
        at
org.apache.soap.util.xml.DOMUtils.getAttributeNS(DOMUtils.java:101)
        at
org.apache.soap.util.xml.DOMUtils.getNamespaceURIFromPrefix(DOMUtils.java:251)
        at
org.apache.soap.encoding.soapenc.SoapEncUtils.getAttributeValue(SoapEncUtils.java:210)
        at
org.apache.soap.encoding.soapenc.ParameterSerializer.unmarshall(ParameterSerializer.java:158)
        at
org.apache.soap.util.xml.XMLJavaMappingRegistry.unmarshall(XMLJavaMappingRegistry.java:260)
        at
org.apache.soap.encoding.soapenc.ParameterSerializer.unmarshall(ParameterSerializer.java:182)
        at
org.apache.soap.util.xml.XMLJavaMappingRegistry.unmarshall(XMLJavaMappingRegistry.java:260)
        at
org.apache.soap.encoding.soapenc.ParameterSerializer.unmarshall(ParameterSerializer.java:182)
        at
org.apache.soap.util.xml.XMLJavaMappingRegistry.unmarshall(XMLJavaMappingRegistry.java:260)
        and so on....



Can anyone give me a clue as to what is wrong with my XML? Or it my
client?

    public void testSimpleService() throws Exception {  
        String targetURI = "urn:test-product-provider";
        String methodName = "getByID";
        Vector params = new Vector();
        params.addElement(
              new Parameter("Id", Integer.class, "1001", null));
        Parameter result = doSoapCall(targetURI, 
                                      methodName, 
                                      params);
        System.out.println (result.getValue());
    }

Thanks,

Michael Reardon