none
Umarshalling error when using .NET to call JAVA webservice RRS feed

  • Question

  • Hi ,

    I met a complicated problem when I trying to call the JAVA webservice as shown below:

    Unmarshalling Error: unexpected element (uri:"http://ws.iam.activenetwork.com/", local:"username"). Expected elements are <{}username>,<{}password>

    And I got the request for the webservice:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://ws.iam.activenetwork.com/">
       <soapenv:Header/>
       <soapenv:Body>
          <authenticate  xmlns:ws="http://ws.iam.activenetwork.com/">
             <!--Optional:-->
             <username>1</username>
             <!--Optional:-->
             <password>2</password>
          </authenticate>
       </soapenv:Body>
    </soapenv:Envelope>

    The response error is :

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
          <soap:Fault>
             <faultcode>soap:Client</faultcode>
             <faultstring>Unmarshalling Error: unexpected element (uri:"http://ws.iam.activenetwork.com/", local:"username"). Expected elements are &lt;{}username>,&lt;{}password></faultstring>
          </soap:Fault>
       </soap:Body>
    </soap:Envelope>

    ----------------------------------------------------

    Then I try to test this webservice with SOAPUI,request body as below:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.iam.activenetwork.com/">
       <soapenv:Header/>
       <soapenv:Body>
          <ws:authenticate>
             <!--Optional:-->
             <username>tt</username>
             <!--Optional:-->
             <password>tt</password>
          </ws:authenticate>
       </soapenv:Body>
    </soapenv:Envelope>

    Response without any error:

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
          <ns2:authenticateResponse xmlns:ns2="http://ws.iam.activenetwork.com/"/>
       </soap:Body>
    </soap:Envelope>

    Could you please help find out the source reason for that? It has been confuesed me for a long time.

    Thanks.

    Tuesday, June 2, 2015 7:36 AM

Answers