1

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.

user2255811
  • 496
  • 2
  • 8
  • 19
  • ASP classic never had any capability to create web services, unless you did it from scratch, by yourself, with no help. Are you seriously not even permitted to install .NET? – John Saunders Jul 01 '13 at 23:53
  • 1
    You CAN create a REST API and consume REST data with ASP classic, it is possible though it may not be exactly what the original framework inventors intended (i.e. it may be a little hackish). See my answer below with links to resources regarding that. – Michael Hawkins Jul 01 '13 at 23:54
  • @Netizen: I did say, "unless you did it from scratch, by yourself, with no help" – John Saunders Jul 01 '13 at 23:59
  • @JohnSaunders but there are some classic ASP utilities people have made, such as JSON parsers, that you can use to piece together a solution. – Michael Hawkins Jul 02 '13 at 00:05
  • @Netizen: compared to something like WCF, this constitutes "from scratch, by yourself, with no help" – John Saunders Jul 02 '13 at 00:10
  • @JohnSaunders Yes, compared to WCF I suppose that could be considered "from scratch" you are correct. – Michael Hawkins Jul 02 '13 at 15:12
  • possible duplicate of [Can I build a REST application using ASP Classic?](http://stackoverflow.com/questions/11147040/can-i-build-a-rest-application-using-asp-classic) – AnonJr Jul 02 '13 at 20:50

2 Answers2

3

Here are a few resources that may provide some of the information you need:

https://softwareengineering.stackexchange.com/questions/88556/how-to-make-classic-asp-interesting-if-you-are-stuck-with-it

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

Community
  • 1
  • 1
Michael Hawkins
  • 2,793
  • 1
  • 19
  • 33
0

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.

Gerald Trost
  • 199
  • 11