DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16180>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16180

Axis only deserializing the first response parameter of document/literal call.

           Summary: Axis only deserializing the first response parameter of
                    document/literal call.
           Product: Axis
           Version: 1.1beta
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Problem:

For document/literal SOAP calls that contain more than one response parameter, 
Axis only deserializes the first response parameter.

I have a .NET service with a method called "testDocMultiPg" that takes 2 
objects and returns them in reverse order:

SOAP Request:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

POST /ws/PRDocTestService/PRDocTest.asmx HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.0

Host: wdorid22k

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: "urn:rcs:test:doc:testDocMultiPg"

Content-Length: 681



<?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>
  <va1 xmlns="urn:rcs:test:doc">
   <customerName>No. 1</customerName>
   <customerAddress>1 main street</customerAddress>
   <customerAge>1</customerAge>
   <customerBalance>1.0</customerBalance>
  </va1>
  <val2 xmlns="urn:rcs:test:doc">
   <customerName>No. 2</customerName>
   <customerAddress>2 main street</customerAddress>
   <customerAge>2</customerAge>
   <customerBalance>2.0</customerBalance>
  </val2>
 </soapenv:Body>
</soapenv:Envelope>




SOAP Response
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

HTTP/1.1 200 OK

Server: Microsoft-IIS/5.0

Date: Thu, 16 Jan 2003 19:35:38 GMT

Cache-Control: private, max-age=0

Content-Type: text/xml; charset=utf-8

Content-Length: 614



<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
  <soap:Body>
    <res1 xmlns="urn:rcs:test:doc">
      <customerName>No. 2</customerName>
      <customerAddress>2 main street</customerAddress>
      <customerAge>2</customerAge>
      <customerBalance>2</customerBalance>
    </res1>
    <res2 xmlns="urn:rcs:test:doc">
      <customerName>No. 1</customerName>
      <customerAddress>1 main street</customerAddress>
      <customerAge>1</customerAge>
      <customerBalance>1</customerBalance>
    </res2>
  </soap:Body>
</soap:Envelope>



When my client code (included at the end this bug) goes to examine the 
response, it finds that only the first response parameter got deserialized and 
the second response parameter is null (despite the fact that you can see the 
correctly formatted response using the tcpmon facility (above)).

I generated the Axis client code with the following command:

   java org.apache.axis.wsdl.WSDL2Java --noWrapped test.wsdl

I found this bug in Axis 1.0 (release version) originally and found the same 
behavior when I tryed the same thing with Axis 1.1 Beta.

At the end of this bug are the WSDL for my service and the client code I used 
to reproduce this behavior.

Dave Dority 
[EMAIL PROTECTED]



WSDL:
----------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:s="http://www.w3.org/2001/XMLSchema"; xmlns:s0="urn:rcs:test:doc" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"; 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; 
targetNamespace="urn:rcs:test:doc" xmlns="http://schemas.xmlsoap.org/wsdl/";>
  <types>
    <s:schema elementFormDefault="qualified" targetNamespace="urn:rcs:test:doc">
      <s:element name="arg1" type="s0:RCSTestObj" />
      <s:complexType name="RCSTestObj">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="customerName" 
type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="customerAddress" 
type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="customerAge" 
type="s:int" />
          <s:element minOccurs="1" maxOccurs="1" name="customerBalance" 
type="s:double" />
        </s:sequence>
      </s:complexType>
      <s:element name="return1" type="s0:RCSTestObj" />
      <s:element name="arg2" type="s0:RCSTestObjList" />
      <s:complexType name="RCSTestObjList">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="unbounded" name="customer" 
type="s0:RCSTestObj" />
        </s:sequence>
      </s:complexType>
      <s:element name="return2" type="s0:RCSTestObjList" />
      <s:element name="va1" type="s0:RCSTestObj" />
      <s:element name="val2" type="s0:RCSTestObj" />
      <s:element name="res1" type="s0:RCSTestObj" />
      <s:element name="res2" type="s0:RCSTestObj" />
      <s:element name="testDocNoReqPrmsResult" type="s:string" />
      <s:element name="arg" type="s:string" />
      <s:element name="string" nillable="true" type="s:string" />
    </s:schema>
  </types>
  <message name="testDocPgSoapIn">
    <part name="arg" element="s0:arg1" />
  </message>
  <message name="testDocPgSoapOut">
    <part name="testDocPgResult" element="s0:return1" />
  </message>
  <message name="testDocPgWithListSoapIn">
    <part name="arg" element="s0:arg2" />
  </message>
  <message name="testDocPgWithListSoapOut">
    <part name="testDocPgWithListResult" element="s0:return2" />
  </message>
  <message name="testDocMultiPgSoapIn">
    <part name="val1" element="s0:va1" />
    <part name="val2" element="s0:val2" />
  </message>
  <message name="testDocMultiPgSoapOut">
    <part name="res1" element="s0:res1" />
    <part name="res2" element="s0:res2" />
  </message>
  <message name="testDocNoReqPrmsSoapIn" />
  <message name="testDocNoReqPrmsSoapOut">
    <part name="testDocNoReqPrmsResult" element="s0:testDocNoReqPrmsResult" />
  </message>
  <message name="testDocNoResPrmsSoapIn">
    <part name="arg" element="s0:arg" />
  </message>
  <message name="testDocNoResPrmsSoapOut" />
  <message name="testDocNoReqPrmsHttpGetIn" />
  <message name="testDocNoReqPrmsHttpGetOut">
    <part name="Body" element="s0:string" />
  </message>
  <message name="testDocNoResPrmsHttpGetIn">
    <part name="arg" type="s:string" />
  </message>
  <message name="testDocNoResPrmsHttpGetOut" />
  <message name="testDocNoReqPrmsHttpPostIn" />
  <message name="testDocNoReqPrmsHttpPostOut">
    <part name="Body" element="s0:string" />
  </message>
  <message name="testDocNoResPrmsHttpPostIn">
    <part name="arg" type="s:string" />
  </message>
  <message name="testDocNoResPrmsHttpPostOut" />
  <portType name="DocTestSoap">
    <operation name="testDocPg">
      <input message="s0:testDocPgSoapIn" />
      <output message="s0:testDocPgSoapOut" />
    </operation>
    <operation name="testDocPgWithList">
      <input message="s0:testDocPgWithListSoapIn" />
      <output message="s0:testDocPgWithListSoapOut" />
    </operation>
    <operation name="testDocMultiPg">
      <input message="s0:testDocMultiPgSoapIn" />
      <output message="s0:testDocMultiPgSoapOut" />
    </operation>
    <operation name="testDocNoReqPrms">
      <input message="s0:testDocNoReqPrmsSoapIn" />
      <output message="s0:testDocNoReqPrmsSoapOut" />
    </operation>
    <operation name="testDocNoResPrms">
      <input message="s0:testDocNoResPrmsSoapIn" />
      <output message="s0:testDocNoResPrmsSoapOut" />
    </operation>
  </portType>
  <portType name="DocTestHttpGet">
    <operation name="testDocNoReqPrms">
      <input message="s0:testDocNoReqPrmsHttpGetIn" />
      <output message="s0:testDocNoReqPrmsHttpGetOut" />
    </operation>
    <operation name="testDocNoResPrms">
      <input message="s0:testDocNoResPrmsHttpGetIn" />
      <output message="s0:testDocNoResPrmsHttpGetOut" />
    </operation>
  </portType>
  <portType name="DocTestHttpPost">
    <operation name="testDocNoReqPrms">
      <input message="s0:testDocNoReqPrmsHttpPostIn" />
      <output message="s0:testDocNoReqPrmsHttpPostOut" />
    </operation>
    <operation name="testDocNoResPrms">
      <input message="s0:testDocNoResPrmsHttpPostIn" />
      <output message="s0:testDocNoResPrmsHttpPostOut" />
    </operation>
  </portType>
  <binding name="DocTestSoap" type="s0:DocTestSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; 
style="document" />
    <operation name="testDocPg">
      <soap:operation soapAction="urn:rcs:test:doc:testDocPg" 
style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="testDocPgWithList">
      <soap:operation soapAction="urn:rcs:test:doc:testDocPgWithList" 
style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="testDocMultiPg">
      <soap:operation soapAction="urn:rcs:test:doc:testDocMultiPg" 
style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="testDocNoReqPrms">
      <soap:operation soapAction="urn:rcs:test:doc:testDocNoReqPrms" 
style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
    <operation name="testDocNoResPrms">
      <soap:operation soapAction="urn:rcs:test:doc:testDocNoResPrms" 
style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
  </binding>
  <binding name="DocTestHttpGet" type="s0:DocTestHttpGet">
    <http:binding verb="GET" />
    <operation name="testDocNoReqPrms">
      <http:operation location="/testDocNoReqPrms" />
      <input>
        <http:urlEncoded />
      </input>
      <output>
        <mime:mimeXml part="Body" />
      </output>
    </operation>
    <operation name="testDocNoResPrms">
      <http:operation location="/testDocNoResPrms" />
      <input>
        <http:urlEncoded />
      </input>
      <output />
    </operation>
  </binding>
  <binding name="DocTestHttpPost" type="s0:DocTestHttpPost">
    <http:binding verb="POST" />
    <operation name="testDocNoReqPrms">
      <http:operation location="/testDocNoReqPrms" />
      <input>
        <mime:content type="application/x-www-form-urlencoded" />
      </input>
      <output>
        <mime:mimeXml part="Body" />
      </output>
    </operation>
    <operation name="testDocNoResPrms">
      <http:operation location="/testDocNoResPrms" />
      <input>
        <mime:content type="application/x-www-form-urlencoded" />
      </input>
      <output />
    </operation>
  </binding>
  <service name="DocTest">
    <documentation>.NET Web Service for testing Document Style SOAP 
Tests</documentation>
    <port name="DocTestSoap" binding="s0:DocTestSoap">
      <soap:address 
location="http://wdorid22k:9999/ws/PRDocTestService/PRDocTest.asmx"; />
    </port>
    <port name="DocTestHttpGet" binding="s0:DocTestHttpGet">
      <http:address 
location="http://wdorid22k/ws/PRDocTestService/PRDocTest.asmx"; />
    </port>
    <port name="DocTestHttpPost" binding="s0:DocTestHttpPost">
      <http:address 
location="http://wdorid22k/ws/PRDocTestService/PRDocTest.asmx"; />
    </port>
  </service>
</definitions>


Sample Client (TestMultipleDocResponseParams.java):
-----------------------------------------------------

//TestMultipleDocResponseParams.java

import rcs.test.doc.*;
import rcs.test.doc.holders.*;

public class TestMultipleDocResponseParams {
        
        public static void main(String[] arg) {
                try {
                        DocTestLocator loc = new DocTestLocator();
                        DocTestSoap dts = loc.getDocTestSoap();
                        
                        //setting up parameters and holders...
                        RCSTestObj arg1 = new RCSTestObj();
                        arg1.setCustomerName("No. 1");
                        arg1.setCustomerAddress("1 main street");
                        arg1.setCustomerAge(1);
                        arg1.setCustomerBalance(1);
                        
                        RCSTestObj arg2 = new RCSTestObj();
                        arg2.setCustomerName("No. 2");
                        arg2.setCustomerAddress("2 main street");
                        arg2.setCustomerAge(2);
                        arg2.setCustomerBalance(2);
                        
                        RCSTestObjHolder hldr1 = new RCSTestObjHolder();
                        RCSTestObjHolder hldr2 = new RCSTestObjHolder();
                        
                        //call service
                        dts.testDocMultiPg(arg1, arg2, hldr1, hldr2);
                        
                        //get results from holders
                        RCSTestObj res1 = hldr1.value;
                        RCSTestObj res2 = hldr2.value;
                        
                        System.out.println("first object:");
                        System.out.println(res1.getCustomerName());
                        System.out.println(res1.getCustomerAddress());
                        System.out.println(res1.getCustomerAge());
                        System.out.println(res1.getCustomerBalance());
                        
                        System.out.println("second object:");
                        System.out.println(res2.getCustomerName());
                        System.out.println(res2.getCustomerAddress());
                        System.out.println(res2.getCustomerAge());
                        System.out.println(res2.getCustomerBalance());
                }
                catch(Exception e) {
                        e.printStackTrace();
                }
        }
}

Reply via email to