1

I am using jQuery AJAX to call a WCF service. The service retuns a JSON string that represents an instance of a custom object.

What I'm writing is meant to replace some current functionality in an existing project. I first wrote a demo project to make sure my new code worked without exposing it to the trappings of the exisiting project. The demo project returns a JSON string formated as {"d":{"__type":"MyObject", "Attribute1":"Value"...}.

Once I had the demo working perfectly, I moved the code into the existing project. The JSON now returns a JSON string formatted as {"Attribute1":"Value"...}. The ".d" and "__type" attributes are missing.

I actually make use of the "__type" attribute, so not having it returned is a problem. I've read that the ".d" attribute was a new addition to ASP.NET 2.0, so my initial thought is that the exisiting project is using an earler version. However, in the examples I've seen of this, the "__type" attribute did exist in the earlier ASP.NET versions, and I've also upgrated the project to .NET 4.0 without any resolution.

Where did the attributes go, and how do I get them back?

4

0 に答える 0