Loading ...
Sorry, an error occurred while loading the content.

1000problem with xmlhttp

Expand Messages
  • Geoff Ellis
    Nov 14, 2001
      people, I'm trying to a javascript soap client to access a cgi SOAP server
      running on linux and display the results using DHTML.
      I've tried to send a soap message similar to the one used in perl's
      SOAP::Lite client, but I keep getting a status of 500 returned... has anyone
      successfully done this interop?
      I'm just trying to see if it's possible..all I want at the moment is to get
      the correct status back from the SOAP::Lite server.
      I'm running apache on the linux box, here is the entry from the
      /var/log/apache/access.log
      >>> 194.201.29.175 - - [14/Nov/2001:16:50:46 +0000] "POST
      /cgi-bin/temper.cgi HTTP/1.1" 500 696

      could someone give the code the once over..

      function sendIt(){
      var xmlhttp =new ActiveXObject("MSXML2.XMLHTTP.3.0");
      var sURL="http://ipofserver/cgi-bin/temper.cgi";
      xmlhttp.Open("POST", sURL, false);
      xmlhttp.setRequestHeader("SOAPAction", "urn:Temperatures#c2f");
      xmlhttp.setRequestHeader("Content-Type", "text/xml");
      var sPayload="<?xml version=\"1.0\" encoding=\"utf-8\"?>"
      sPayload+="<soap:Envelope
      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
      xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
      xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"
      xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\">"
      sPayload+=" <SOAP-ENV:Body>"
      sPayload+="<namesp1:c2f xmlns:namesp1=\"urn:Temperatures\">"
      sPayload+="<c-gensym3 xsi:type=\"xsd:float\">37.5</c-gensym3>"
      sPayload+="</namesp1:c2f>"
      sPayload+="</SOAP-ENV:Body>"
      sPayload+="</SOAP-ENV:Envelope>"
      alert (sPayload); // display the soap payload..
      xmlhttp.Send(sPayload);
      debug.innerHTML = "status: " +xmlhttp.status+ "<BR>";

      delete xmlhttp;
      }

      TIA
      Geoff
    • Show all 2 messages in this topic