[Mono-aspnet-list] RES: ScriptService with JSON instead of WebService -- how?
edgarrc at gmail.com
Mon Nov 26 15:36:04 UTC 2012
Maybe this solution can help you, see all answers.
De: mono-aspnet-list-bounces at lists.ximian.com
[mailto:mono-aspnet-list-bounces at lists.ximian.com] Em nome de Mikko Vuoti
Enviada em: quinta-feira, 22 de novembro de 2012 15:18
Para: mono-aspnet-list at lists.ximian.com
Assunto: [Mono-aspnet-list] ScriptService with JSON instead of WebService --
There seems to be a few questions and answers around on this subject, but so
far I have not found the missing piece of wisdom to get my script service
app. However, I can't get the method configured so that it would return JSON
instead of XML.
Here is the trivial C#
public class MyService : WebService
public string Hello(string name)
return("Hello, " + name);
I have added the reference to System.Web.Extensions.
I have also generated the web.config (mconfig --target=web af AJAX), not
sure if this has to do with the problem, though.
The code above doesn't make the service available. If I add
[WebService]/[WebMethod] attributes to the class/method definition the
method becomes available as a regular web service, i.e. it returns XML - not
I've been testing on Mono / .NET 3.5 and 4.0.
Any pointer to a resource explaining how script services should be set up
with mono is warmly welcome!
thanks your time!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-aspnet-list