Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
-1
rated 0 times [  5] [ 6]  / answers: 1 / hits: 35427  / 15 Years ago, thu, november 5, 2009, 12:00:00

I have the following test method:



Imports System.Web

Imports System.Web.Services

Imports System.Web.Services.Protocols


<WebService(Namespace:=http://tempuri.org/)> _

<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _

<System.Web.Script.Services.ScriptService()> _

Public Class DemoService
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function GetCustomer() As String
Return Microsoft
End Function


End Class


Even with the ResponseFormat attribute added the response is still being returned as XML rather than JSON.



Thoughts appreciated.


More From » asp.net

 Answers
220

Do you have .NET 3.5 or greater installed?



ScriptServiceAttribute is in .NET 3.5 and 4.0.



Also, clear your ASP.NET temp files, the dynamic proxy could be cached.


[#98385] Friday, October 30, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
carterf

Total Points: 255
Total Questions: 93
Total Answers: 122

Location: Marshall Islands
Member since Wed, Jun 17, 2020
4 Years ago
;