title: "The specified type was not recognized" exception when trying to invoke a webservice call
body: <p>I'm trying to call a third party webservice using WSE 3.0 as a client in Visual Studio 2005.</p>
  
  <p>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 <code>InvalidOperationException</code>:</p>
  
  <blockquote>
    <p>There is en error in the XML document.</p>
  </blockquote>
  
  <p>with an <code>InnerException</code>: </p>
  
  <blockquote>
    <p>The specified type was not recognized: name='Map', namespace='<a href="http://xml.apache.org/xml-soap" rel="nofollow noreferrer">http://xml.apache.org/xml-soap</a>', at &lt;bevoegdheid xmlns=''&gt;.</p>
  </blockquote>
  
  <p>This is the relevant part of the response:</p>
  
  <pre><code> &lt;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;
      &lt;SOAP-ENV:Body&gt;
        &lt;SOAP-ENV:opvragenKeurmeesterGegevensResponse&gt;
          &lt;opvragenKeurmeesterGegevensReturn xsi:type="ns2:Backend_Apk_Result_OpvragenKeurmeesterGegevens"&gt;
            &lt;naam xsi:type="xsd:string"&gt;A name&lt;/naam&gt;
            ...
            &lt;bevoegdheid SOAP-ENC:arrayType="ns1:Map[2]" xsi:type="SOAP-ENC:Array"&gt;
              &lt;item xsi:type="ns1:Map"&gt;
                &lt;item&gt;
                  &lt;key xsi:type="xsd:string"&gt;soortBevoegdheid&lt;/key&gt;
                  &lt;value xsi:type="xsd:string"&gt;AL&lt;/value&gt;
                &lt;/item&gt;
            ...
              &lt;/item&gt;
              &lt;item&gt;
            ...
              &lt;/item&gt;
            &lt;/bevoegdheid&gt;
            &lt;meldingSoort xsi:nil="true" /&gt;
            &lt;meldingNummer xsi:nil="true" /&gt;
            &lt;melding xsi:nil="true" /&gt;
          &lt;/opvragenKeurmeesterGegevensReturn&gt;
        &lt;/SOAP-ENV:opvragenKeurmeesterGegevensResponse&gt;
      &lt;/SOAP-ENV:Body&gt;
    &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>And this is how that "bevoegdheid" is defined in the wsdl:</p>
  
  <pre><code>  &lt;xsd:element name="bevoegdheid" type="soap-enc:Array" /&gt; 
  </code></pre>
  
  <p>There is no mention of a "Map" type anywhere in the wsdl.</p>
  
  <p>I have been googling around for this, but the only kind of answer I've found is something along the lines of </p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>But as this is a third party service (which is already used by other clients), this is no option for us.</p>
  
  <p>Any other suggestions? How can I get the xml parser to recognize that "Map" type?</p>