Using SOAP in classic ASP

Explanation: This is not about calling user agents on pages, but a classic ASP.NET call!

I have applications that are halfway through the transition from classic ASP to ASP.NET. There are half a million lines of code, so a complete rewrite of everything at once was simply not believable or frankly reasonable, given that the vast majority of ASP pages in ASP just worked fine. We translate pages and features as they are suitable for revision anyway, and not just because it is β€œcool”.

Now that approximately half of the pages have been converted, we have moved some key features to ASP.NET. Instead of preserving legacy versions of this functionality (which means two places to support instead of one), I moved on to use SOAP to expose this function.

Well, not quite. Instead, we use what I called the SOAP Poor Man, although today it is fashionable to call REST. I use ServerXMLHTTP to link to the landing page by combining an XML bead and POSTing it on the ASP.NET side. As a result, I combined some XML and used XPATH to tear it into variables.

All this works surprisingly well. However, I looked at the ASP.NET SOAP built-in functions, which seem to eliminate the need to personalize the handle pages for my cross-platform calls ... but when I look at SOAP consumption from classic ASP, you suggest using seemingly discounted Soap Tools.

The question is: do any of you have experience with similar settings, and if there are any more efficient ways to do this than custom REST or Soap Toolkit pages? I think the possibility of faster access to ASP.NET features would help with porting, but I don’t want myself to get bogged down with legacy technologies like the Soap Toolkit, unnecessarily.

+4
source share
3 answers

After a few more searches, I found

Calling REST web services from a classic asp page

which, in turn, is associated with

http://www.aspfree.com/c/a/ASP/Consuming-a-WSDL-Webservice-from-ASP/

This is pretty much what I'm doing now, so maybe this is the best solution?

+4
source

I use Prototype with many classic ASP pages for AJAX calls. I prefer working with JSON over XML for my data layer. Ajax + JSON is much easier, faster, and easier to work than SOAP + XML.

+1
source

I was able to do this with the following code, obviously you will need to change some things, but hopefully this can get you started:

Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.open "POST", soapServer, False xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8" xmlhttp.setRequestHeader "SOAPAction", char(34) & "WebPlatform.WebServices/ISessionTokenServiceV1/CreateSessionToken" & char(34) xmlhttp.send soapMessage 

soapMEssage will be the soap request that you submit. soapServer is the URL of the web service, for example: http: // localhost: 8000 / WebServices / SampleService.svc / BASIC

+1
source

All Articles