Hi John,
 
I am getting the same when I return a BeanArray using Wrapped document/literal - Axis 1.3
 
Also when returning just a Bean which contains a bean array, this bean array has the same problem.
 
Also, I found when the service runs a second time, the return bean array problem does not occur, it was only on the first request.
 
Looking at some Apache Axis logging, I noticed that a setReturnType ( qname ) call on the OperationDesc object was using a null, so I put some code in to set the qname of the OperationDesc.setReturnType method and it starting working on the first go.
 
The Bean containing a bean array still has the problem.
 
=============================================================================
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 
  <soapenv:Body>
 
    <getEmployeesResponse xmlns="http://server.soap.acme.com">
 
      <getEmployeesReturn>
 
        <ns1:getEmployeesReturn xmlns:ns1="http://server.soap.acme.com" xsi:type="ns1:Employee">
 
          <ns1:employee_id xsi:type="xsd:string">A1001</ns1:employee_id>
 
          <ns1:first_name xsi:type="xsd:string">BEN</ns1:first_name>
 
          <ns1:salary xsi:type="xsd:double">2345.82</ns1:salary>
 
          <ns1:surname xsi:type="xsd:string">JONES</ns1:surname>
 
        </ns1:getEmployeesReturn>
 
        <ns2:getEmployeesReturn xmlns:ns2="http://server.soap.acme.com" xsi:type="ns2:Employee">
 
          <ns2:employee_id xsi:type="xsd:string">A1012</ns2:employee_id>
 
          <ns2:first_name xsi:type="xsd:string">PATRICK</ns2:first_name>
 
          <ns2:salary xsi:type="xsd:double">26456.04</ns2:salary>
 
          <ns2:surname xsi:type="xsd:string">PAUL</ns2:surname>
 
        </ns2:getEmployeesReturn>
 
      </getEmployeesReturn>
 
    </getEmployeesResponse>
 
  </soapenv:Body>
 
</soapenv:Envelope>
=============================================================================
 
 
-----Original Message-----
From: John Prout [mailto:[EMAIL PROTECTED]
Sent: Monday, 13 February 2006 4:31 PM
To: [email protected]
Subject: Strange WSDL -> SOAP type mapping; can anyone explain

I have written a service that returns an array of Name/Value pairs and then de-serializes to a Java HashMap. This works so far, but monitoring the SOAP data stream that's returned, I'm puzzled by the schema returned. I'll include the WSDL and SOAP at the end of this posting, but to summerize:
 
I would expect the <soapenv:envelope> to contain something like this:
 
<GetMemberProfileResponse xmlns="http://api.ws.digitalimpact.com">
  <retValues>
       <NVPair>
          <NVPair>
            <NVname>firstName</NVname>
            <NVvalue>John</NVvalue>
          </NVPair>
          <NVPair>
            <NVname>registrationDate</NVname>
            <NVvalue>2006-01-26 15:12:00.0 </NVvalue>
          </NVPair>
  </retValues>
<GetMemberProfileResponse>
 
But instead I get:
 
<GetMemberProfileResponse xmlns="http://api.ws.digitalimpact.com">
  <retValues>
    <retValues>
          <NVPair>        
            <NVname>firstName</NVname>
            <NVvalue>John</NVvalue>
          </NVPair>
          <NVPair>
            <NVname>registrationDate</NVname>
            <NVvalue>2006-01-26 15:12:00.0</NVvalue>
          </NVPair>
  </retValues>
<GetMemberProfileResponse>
 
See that <NVPair> has been replaced by a repeat of <retValues>
 
I will need to call this service from .NET and I think this will be a problem.
 
This service is using Axis 1.2.1 in tomcat 5.5.9. I built the service from WSDL, using wsdl2java.
 
Does anyone know why this is happening?
 
Thanks in advance:
 
John
 
The WSDL is as follows:
 
<?xml version="1.0" encoding="UTF-8"?>
<definitions
    name="API.wsdl"
    targetNamespace="http://api.ws.myco.com"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://api.ws.myco.com"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <documentation>Digital Impact API</documentation>
    <types>
        <xsd:schema
            targetNamespace="http://api.ws.myco.com"
            xmlns:SOAP-ENC=" http://schemas.xmlsoap.org/soap/encoding/"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
            <xsd:element name="GetMemberProfile" type="tns:GetMemberProfileType"/>
            <xsd:element name="GetMemberProfileResponse" type="tns:GetMemberProfileResponseType"/>
            <xsd:complexType name="NVPairType">
                <xsd:sequence>
                    <xsd:element name="NVname" type="xsd:string"/>
                    <xsd:element name="NVvalue" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>
           
            <xsd:complexType name="NVPairArrayType">
                <xsd:sequence>
                    <xsd:element name="NVPair" minOccurs="0" maxOccurs="unbounded" type="tns:NVPairType"/>
                </xsd:sequence>
            </xsd:complexType>
           
            <xsd:complexType name="GetMemberProfileType">
                <xsd:sequence>
                    <xsd:element name="emailAddress" type="xsd:string"/>
                    <xsd:element name="vendorId" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="GetMemberProfileResponseType">
                <xsd:sequence>
                    <xsd:element name="retValues" type="tns:NVPairArrayType"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:schema>
    </types>
    <message name="GetMemberProfileRequest">
        <part element="tns:GetMemberProfile" name="parameters"/>
    </message>
    <message name="GetMemberProfileResponse">
        <part element="tns:GetMemberProfileResponse" name="response"/>
    </message>
    <portType name="ApiService">
        <operation name="GetMemberProfile">
            <input message="tns:GetMemberProfileRequest"/>
            <output message="tns:GetMemberProfileResponse"/>
        </operation>
    </portType>
    <binding name="ApiBinding" type="tns:ApiService">
        <soap:binding style="document" transport=" http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GetMemberProfile">
            <soap:operation soapAction=""/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="ApiEndPoint">
        <port binding="tns:ApiBinding" name="ApiService">    
            <soap:address location="http://localhost"/>
        </port>
    </service>
</definitions>
 
An expample of the SOAP response (from TCPMonitor) is:
 
<?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>
         <GetMemberProfileResponse xmlns="http://api.ws.myco.com">
            <retValues>
               <retValues>
                  <NVname>phone</NVname>
                  <NVvalue>650 372 2000</NVvalue>
               </retValues>
               <retValues>
                  <NVname>registrationDate</NVname>
                  <NVvalue>2006-01-26 15:12: 00.0</NVvalue>
               </retValues>
               <retValues>
                  <NVname>address1</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>countryCode</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>JOB_FUNCTION</NVname>
                  <NVvalue>Manager</NVvalue>
               </retValues>
               <retValues>
                  <NVname>firstName</NVname>
                  <NVvalue>John</NVvalue>
               </retValues>
               <retValues>
                  <NVname>address2</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>invalidationDate</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>COMPANY_NAME</NVname>
                  <NVvalue>MyCo</NVvalue>
               </retValues>
               <retValues>
                  <NVname>registrationSource</NVname>
                  <NVvalue>API_EXT</NVvalue>
               </retValues>
               <retValues>
                  <NVname>city</NVname>
                  <NVvalue>San Mateo</NVvalue>
               </retValues>
               <retValues>
                  <NVname>gender</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>areaCode</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>emailFormatRequested</NVname>
                  <NVvalue>Best Available</NVvalue>
               </retValues>
               <retValues>
                  <NVname>PREFERRED_METHOD_CONTACT</NVname>
                  <NVvalue>Phone</NVvalue>
               </retValues>
               <retValues>
                  <NVname>birthMonth</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>memberId</NVname>
                  <NVvalue>1095667156</NVvalue>
               </retValues>
               <retValues>
                  <NVname>deregistrationDate</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>valid</NVname>
                  <NVvalue>1</NVvalue>
               </retValues>
               <retValues>
                  <NVname>birthDay</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>lastName</NVname>
                  <NVvalue>Prout</NVvalue>
               </retValues>
               <retValues>
                  <NVname>zipCode</NVname>
                  <NVvalue>94117</NVvalue>
               </retValues>
               <retValues>
                  <NVname>birthYear</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>country</NVname>
                  <NVvalue>value=</NVvalue>
               </retValues>
               <retValues>
                  <NVname>LATEST_SOURCE</NVname>
                  <NVvalue>ContactmeForm_N1_gt5</NVvalue>
               </retValues>
               <retValues>
                  <NVname>state</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>email</NVname>
                  <NVvalue> [EMAIL PROTECTED]</NVvalue>
               </retValues>
               <retValues>
                  <NVname>deregistrationSource</NVname>
                  <NVvalue></NVvalue>
               </retValues>
               <retValues>
                  <NVname>invalidationCode</NVname>
                  <NVvalue></NVvalue>
               </retValues>
            </retValues>
         </GetMemberProfileResponse>
      </soapenv:Body>
   </soapenv:Envelope>

 

Reply via email to