Reputation: 496
I need to create a Web Service in ASP classic(no choice unfortunately) but I need to do it using more modern standards like using JSON instead of SOAP. I'v been searching the web but I can't seem to find any way to do this. Is it even possible? and if it is can you please show me a tutorial or example.
Upvotes: 1
Views: 9929
Reputation: 189
My c# WebService Class has these Compiler Tags:
[WebService(Namespace = "http://myWebService/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
Since it was requested that the WebService can also communicate with JSON clients we added this Compiler Tag:
[ScriptService]
Methods are tagged with
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
It all works fine with SOAP clients and with JSON clients but the JSON Developers want to get Standard Status Codes in case the WebService throws an Exception and I don't know how to accomplish this.
Upvotes: 0
Reputation: 2873
Here are a few resources that may provide some of the information you need:
Calling REST web services from a classic asp page
Can I build a REST application using ASP Classic?
ASP Classic example of REST / JSON call: https://gist.github.com/joseph-montanez/1948929
Upvotes: 3