views:

217

answers:

1

I'm trying to call a third party webservice using WSE 3.0 as a client in Visual Studio 2005.

The call works fine and I can see that I get a good response (I have tracing enabled), but apparently the xml parser chokes over it. I always get an InvalidOperationException:

There is en error in the XML document.

with an InnerException:

The specified type was not recognized: name='Map', namespace='http://xml.apache.org/xml-soap', at <bevoegdheid xmlns=''>.

This is the relevant part of the response:

 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="https://acceptatie.cartalk.nl/Soap/Apk" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
    <SOAP-ENV:Body>
      <SOAP-ENV:opvragenKeurmeesterGegevensResponse>
        <opvragenKeurmeesterGegevensReturn xsi:type="ns2:Backend_Apk_Result_OpvragenKeurmeesterGegevens">
          <naam xsi:type="xsd:string">A name</naam>
          ...
          <bevoegdheid SOAP-ENC:arrayType="ns1:Map[2]" xsi:type="SOAP-ENC:Array">
            <item xsi:type="ns1:Map">
              <item>
                <key xsi:type="xsd:string">soortBevoegdheid</key>
                <value xsi:type="xsd:string">AL</value>
              </item>
          ...
            </item>
            <item>
          ...
            </item>
          </bevoegdheid>
          <meldingSoort xsi:nil="true" />
          <meldingNummer xsi:nil="true" />
          <melding xsi:nil="true" />
        </opvragenKeurmeesterGegevensReturn>
      </SOAP-ENV:opvragenKeurmeesterGegevensResponse>
    </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>

And this is how that "bevoegdheid" is defined in the wsdl:

  <xsd:element name="bevoegdheid" type="soap-enc:Array" /> 

There is no mention of a "Map" type anywhere in the wsdl.

I have been googling around for this, but the only kind of answer I've found is something along the lines of

The service uses rpc/encoded format which is harder to get interoperability with. If you can change the server to document/literal it is better.

But as this is a third party service (which is already used by other clients), this is no option for us.

Any other suggestions? How can I get the xml parser to recognize that "Map" type?

A: 

There may be a couple of problems here. One maybe the following:

<bevoegdheid SOAP-ENC:arrayType="ns1:Map[2]" xsi:type="SOAP-ENC:Array">

in the soap message. The parser may not like the fact that there is a case mismatch between the WSDL type attribute definition for the "bevoegdheid" element and the xsi:type value of the element in the soap message. This issue may cause the actual (somewhat misleading) exception you're seeing. I'm not sure how to fix something like that since you don't control either component.

The exception message is saying the arrayType value of "ns1:Map[2]" is not a valid element name of the ns1 namespace. That namespace is should be defined in the XSD for "http://xml.apache.org/xml-soap" but it appears it isn't. Unfortunately, the fundamental problem may be that the service is generating soap messages that don't appear to be consistent with the WSDL for the service. Good luck!

Sixto Saez