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

problem with xmlhttp

Expand Messages
  • Geoff Ellis
    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 1 of 2 , Nov 14, 2001
    • 0 Attachment
      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
    • Paul Kulchenko
      Hi, Geoff! And how the response envelope looks like? ... According to the log file server sends something back. Could you show this response? The reason for
      Message 2 of 2 , Nov 14, 2001
      • 0 Attachment
        Hi, Geoff!

        And how the response envelope looks like?

        > >>> 194.201.29.175 - - [14/Nov/2001:16:50:46 +0000] "POST
        > /cgi-bin/temper.cgi HTTP/1.1" 500 696
        According to the log file server sends something back. Could you show
        this response? The reason for faul may be something as simple as
        unquoted SOAPAction. You have:

        xmlhttp.setRequestHeader("SOAPAction", "urn:Temperatures#c2f");

        that will generate (not sure about this one)

        SOAPAction: urn:Temperatures#c2f

        whereas it should be

        SOAPAction: "urn:Temperatures#c2f"

        It might be also something else. In any case, response envelope that
        contains fault description will definitely help.

        Best wishes, Paul.

        --- Geoff Ellis <geoff@...> wrote:
        > 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
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Find the one for you at Yahoo! Personals
        http://personals.yahoo.com
      Your message has been successfully submitted and would be delivered to recipients shortly.