Note that there are some explanatory texts on larger screens.

plurals
  1. POElement ':item' contains data from a type that maps to the name 'http://...:Location'. The deserializer has no knowledge of any type that maps to thi
    text
    copied!<p>I'm writing code to consume the Bing Geocode service (Bing Maps), and I am successfully able to pull JSON data via wcf, unfortunately I seem to be unable to map a piece of the data returned.</p> <p>I created all the appropriate DataContracts as needed and populated them with the required members, but I when I start getting into the children I get the following error:</p> <p>Element ':item' contains data from a type that maps to the name 'http://schemas.microsoft.com/search/local/ws/rest/v1:Location'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'Location' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.</p> <p>So I commented out the "children" objects, and was basically able to discern that it was blowing up when it tries to read the 'Location' part of the JSON object</p> <p>in my code below, it concerns the part here:</p> <pre><code> "__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1", </code></pre> <p>for what its worth, the url is bad, but I don't care. I don't want to use that type (which apparently maps back to a schema at Microsoft's website). Is there a way to tell WCF to ignore that link? Its not like <em>I</em> can. </p> <p>What Bing returns</p> <pre><code>{ "authenticationResultCode":"ValidCredentials", "brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png", "copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.", "resourceSets":[ { "estimatedTotal":1, "resources":[ { "__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1", "bbox":[ 47.635884282429323, -122.13737419709076, 47.643609717570676, -122.12208780290925 ], "name":"1 Microsoft Way, Redmond, WA 98052-8300", "point":{ "type":"Point", "coordinates":[ 47.639747, -122.129731 ] }, "address":{ "addressLine":"1 Microsoft Way", "adminDistrict":"WA", "adminDistrict2":"King County", "countryRegion":"United States", "formattedAddress":"1 Microsoft Way, Redmond, WA 98052-8300", "locality":"Redmond", "postalCode":"98052-8300" }, "confidence":"High", "entityType":"Address" } ] } ], "statusCode":200, "statusDescription":"OK", "traceId":"43c6a4dc130749bbb14eb72bf12c4198 " } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload