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 Jeff Greif <jg...@alumni.princeton.edu> on 2002/10/15 05:15:16 UTC

[WSIF] + Axis serialization problem

I have a version of the WSIF DynamicInvoker client which handles complex
types in input and output.  I try exactly the same WS invocation (of
Amazon's service) with the WSIFDynamicProvider flavors _ApacheAxis and
_ApacheSOAP.  Things work fine with the Soap Provider against the 2002/10/14
nightly build of Axis and WSIF, but the Axis provider produces incorrect
messages in various configurations (shown below).  I have my own
serializer/deserializer code for the complex type (e.g. KeywordRequest
below), so it's possible that the problem is either in that code or how it's
hooked in (I have verified that my serializer is being called).  I'd
appreciate suggestions.

The SOAP provider works fine, producing the message:

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchem
a-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:KeywordSearchRequest xmlns:ns1="urn:PI/DevCentral/SoapService"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/s
oap/encoding/">
<KeywordSearchRequest xmlns:m="urn:PI/DevCentral/SoapService"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:
type="m:KeywordRequest"><keyword
xsi:type="xsd:string">bioinformatics</keyword><page
xsi:type="xsd:string">1</page><mode
 xsi:type="xsd:string">books</mode><tag
xsi:type="xsd:string">webservices-20</tag><type
xsi:type="xsd:string">lite</type
><devtag xsi:type="xsd:string">BlahBlahBlah</devtag></KeywordSearchRequest>
</ns1:KeywordSearchRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The Axis provider produces a multiref which at minimum is incorrect because
it has the wrong type (ProductInfo is not relevant to the input message --
it is the type of the response return part!):

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:KeywordSearchRequest
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:PI/DevCentr
al/SoapService">
   <arg0 href="#id0"/>
  </ns1:KeywordSearchRequest>
  <multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:Pr
oductInfo" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="urn:PI/DevCentral/SoapService">
   <KeywordSearchRequest xsi:type="m:KeywordRequest"
xmlns:m="urn:PI/DevCentral/SoapService" xmlns:xsi="http://www.w3.or
g/1999/XMLSchema-instance">
    <keyword xsi:type="xsd:string">bioinformatics</keyword>
    <page xsi:type="xsd:string">1</page>
    <mode xsi:type="xsd:string">books</mode>
    <tag xsi:type="xsd:string">webservices-20</tag>
    <type xsi:type="xsd:string">lite</type>
    <devtag xsi:type="xsd:string">BlahBlahBlah</devtag>
   </KeywordSearchRequest>
  </multiRef>
 </soapenv:Body>
</soapenv:Envelope>

If I turn off multirefs using:
      ((WSIFPort_ApacheAxis)port).getCall().getService().getEngine()
   .setOption(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, new
Boolean(false));
then the correct message part is wrapped with a bogus arg0 element of the
similarly wrong type (the contents of the arg0 element should replace it):

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:KeywordSearchRequest
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:PI/DevCentr
al/SoapService">
   <arg0 xsi:type="ns1:ProductInfo">
    <KeywordSearchRequest xsi:type="m:KeywordRequest"
xmlns:m="urn:PI/DevCentral/SoapService" xmlns:xsi="http://www.w3.o
rg/1999/XMLSchema-instance">
     <keyword xsi:type="xsd:string">bioinformatics</keyword>
     <page xsi:type="xsd:string">1</page>
     <mode xsi:type="xsd:string">books</mode>
     <tag xsi:type="xsd:string">webservices-20</tag>
     <type xsi:type="xsd:string">lite</type>
     <devtag xsi:type="xsd:string">BlahBlahBlah</devtag>
    </KeywordSearchRequest>
   </arg0>
  </ns1:KeywordSearchRequest>
 </soapenv:Body>
</soapenv:Envelope>