Wednesday, March 21, 2012

Web Service Access using JavaScript

I've installed the ASP.NET Futures on my dev machine after VS 2008 with .NET 3.5 was installed. When I attempt to access my webservice marked as Namespace.Class.Function, I receive a JavaScript error stating 'TestNamespace' is undefined. Any ideas what could be happening? It seems to occur when I add the converters in my web.config file:

<jsonSerialization maxJsonLength="8388608"> <converters> <add name="DataSetConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataSetConverter, Microsoft.Web.Preview"/> <add name="DataRowConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataRowConverter, Microsoft.Web.Preview"/> <add name="DataTableConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataTableConverter, Microsoft.Web.Preview"/> </converters></jsonSerialization>

Got it. Wrong version of the Microsoft.Web.Preview.dll file in the bin.


Can you please let me know the right version? I can't find a download for the .net 3.5 version of this DLL on ajax.asp.net website, only the July 2007 version.

Thanks

Angie


I've tracked this down. Web.config required the following entry for it to work.

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

No comments:

Post a Comment