Get SOAP to work in classic ASP

Posted on 2007-10-10
Last Modified: 2012-05-05
I'm trying to get SOAP to work in classic asp.

Here's the code:
set xmldom = server.CreateObject("Microsoft.XMLDOM")
set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")

const SoapServer = "" "POST", SoapServer, false
xmlhttp.setRequestHeader "Man", POST & " " & SoapServer & " HTTP/1.1"
xmlhttp.setRequestHeader "MessageType", "CALL"
xmlhttp.setRequestHeader "Content-Type", "text/xml"

'Anything other than 200 means error.
if xmlhttp.Status = 200 then
  'collects the data returned.
  Set xmldom = xmlhttp.responseXML
  'writes it to the screen.

'Just some error checking. I use this to see why its messing up.
  Response.Write("Didn't Work")

 'Writes the error code  returned by the server.

  'Writes the accompanying text.
End if

set xmlhttp = nothing
set xmldom = nothing


Here's the response:
Didn't Workstatus=405Method Not AllowedHTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:en-us HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727) HTTP_X_FORWARDED_FOR:

soap_rate_request.xml is an xml file with the soap envelope. I could show that but there is no way to attach files in Experts Exchange
Question by:Richard Korts
    1 Comment
    LVL 19

    Accepted Solution

    Two things:
    1) Are you sure is valid address? It doesn't seem to host any web service

    2) xmlhttp.setRequestHeader "Man", POST & " " & SoapServer & " HTTP/1.1"
    What is POST? Are you sure you aren't missing quotes?
    xmlhttp.setRequestHeader "Man", "POST " & SoapServer & " HTTP/1.1"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now