views:

52

answers:

1

Hi,

I need to call a web service from my classic ASP website. I have been provided with a URL and three variables from the SOAP provider:

URL of web service: http://www.theirwebsite.co.uk/B2bservice.asmx Parameter1: CustId Parameter2: PWord Parameter3: OrderNo

So I'm supposed to send this SOAP request from my classic ASP website, along with the parameter values (which I've been given too) and it's supposed to return a string.

I've tested the SOAP response using soapclient.com, and sure enough if I enter the web service URL and add the paramter values, it returns a string, like it should.

The problem is I just can't find how to do it with classic ASP!! I've found numerous examples of calling a SOAP URL from classic ASP, but none of them mention how to pass parameters.

Can someone please show me a simple-as-possible implementation of how I get the return string from this web service in ASP, passing the parameters in?

Many thanks in advance for any help.

A: 

I don't know much about classic ASP and don't know if it has a SOAP client implementation, but if classic ASP allows you to send an HTTP POST with an arbitrary body and arbitrary HTTP headers, it should be possible to do what you want (in a somewhat hacky way).

Just issue a POST request with the entire SOAP message hard-coded except for your parameters. Make sure to get the Content-Type and SOAPAction headers right.

If you don't know how to properly create a valid SOAP message and to properly set the headers, use a tool like http://web.progress.com/en/actional/actional-diagnostics.html to send a test message, then use a tool like Fiddler to take a look at what was actually sent, and then hard-code it into your app.

Eugene Osovetsky
Dan