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