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

SOAPing with perl and c++

Expand Messages
  • baka1us
    Hi Paul, I am writing a client program using SOAP::Lite connect to my C++ server program using gSOAP that talk to my oracle box. Here is the code,
    Message 1 of 2 , Jan 30, 2002
    • 0 Attachment
      Hi Paul,

      I am writing a client program using SOAP::Lite connect to my C++
      server program using gSOAP that talk to my oracle box.

      Here is the code,

      #!/usr/bin/perl -w

      $statement = "SELECT * from name";

      use SOAP::Lite on_debug => sub { print @_ };

      print SOAP::Lite
      -> uri('')
      -> on_action(sub { sprintf '""' })
      -> proxy('http://192.168.1.2:3303')
      -> sql($statement)
      -> result;

      and this is the error msg I get,

      500 (Internal Server Error) unexpected EOF before status line seen

      The function "sql" expects an SQL statement and query the oracle box.
      I was able to do it writing both in C++. However I am having
      difficult with perl.

      This is the log file I get when calling with my c++ program,

      POST / HTTP/1.0
      Host: 192.168.1.2
      Content-Type: text/xml
      Content-Length: 493
      SOAPAction: ""

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope xmlns:SOAP-
      ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encodi
      ng/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:ns="urn:sql" SOAP-
      ENV:
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-
      ENV:Body>
      <ns:sql><statement xsi:type="string">SELECT * from name</statement>
      </ns:sql>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
      Status: 200 OK
      Content-Type: text/xml
      Content-Length: 509

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope xmlns:SOAP-
      ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encodi
      ng/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:ns="urn:sql" SOAP-
      ENV:
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-
      ENV:Body>
      <ns:sqlResponse xsi:type="ns:sqlResponse"><result
      xsi:type="int">0</result>
      </ns:sqlResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      Any helps are greatly appreciated,
      Sing
    • Paul Kulchenko
      Hi, Sing! I don t see any problem in your code, but wiredump looks strange. I would expect to see HTTP/1.1 200 OK as the first line of response wiredump,
      Message 2 of 2 , Jan 30, 2002
      • 0 Attachment
        Hi, Sing!

        I don't see any problem in your code, but wiredump looks strange.

        I would expect to see

        HTTP/1.1 200 OK

        as the first line of response wiredump, rather than 'Status: 200 OK'

        > Status: 200 OK
        > Content-Type: text/xml
        > Content-Length: 509

        What's on the server side (webserver)? Have you tried other clients?
        Looks like server sends SOAP payload back, but response is not
        properly formatted as HTTP response, so Perl client complains. If you
        use Apache, maybe you can configure it to generate proper headers.
        Let me know if you still have problems.

        Best wishes, Paul.

        --- baka1us <sli@...> wrote:
        > Hi Paul,
        >
        > I am writing a client program using SOAP::Lite connect to my C++
        > server program using gSOAP that talk to my oracle box.
        >
        > Here is the code,
        >
        > #!/usr/bin/perl -w
        >
        > $statement = "SELECT * from name";
        >
        > use SOAP::Lite on_debug => sub { print @_ };
        >
        > print SOAP::Lite
        > -> uri('')
        > -> on_action(sub { sprintf '""' })
        > -> proxy('http://192.168.1.2:3303')
        > -> sql($statement)
        > -> result;
        >
        > and this is the error msg I get,
        >
        > 500 (Internal Server Error) unexpected EOF before status line seen
        >
        > The function "sql" expects an SQL statement and query the oracle
        > box.
        > I was able to do it writing both in C++. However I am having
        > difficult with perl.
        >
        > This is the log file I get when calling with my c++ program,
        >
        > POST / HTTP/1.0
        > Host: 192.168.1.2
        > Content-Type: text/xml
        > Content-Length: 493
        > SOAPAction: ""
        >
        > <?xml version="1.0" encoding="UTF-8"?>
        > <SOAP-ENV:Envelope xmlns:SOAP-
        > ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-
        > ENC="http://schemas.xmlsoap.org/soap/encodi
        > ng/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        > xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:ns="urn:sql"
        > SOAP-
        > ENV:
        > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-
        > ENV:Body>
        > <ns:sql><statement xsi:type="string">SELECT * from name</statement>
        > </ns:sql>
        > </SOAP-ENV:Body>
        > </SOAP-ENV:Envelope>
        > Status: 200 OK
        > Content-Type: text/xml
        > Content-Length: 509
        >
        > <?xml version="1.0" encoding="UTF-8"?>
        > <SOAP-ENV:Envelope xmlns:SOAP-
        > ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-
        > ENC="http://schemas.xmlsoap.org/soap/encodi
        > ng/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        > xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:ns="urn:sql"
        > SOAP-
        > ENV:
        > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-
        > ENV:Body>
        > <ns:sqlResponse xsi:type="ns:sqlResponse"><result
        > xsi:type="int">0</result>
        > </ns:sqlResponse>
        > </SOAP-ENV:Body>
        > </SOAP-ENV:Envelope>
        >
        > Any helps are greatly appreciated,
        > Sing



        __________________________________________________
        Do You Yahoo!?
        Great stuff seeking new owners in Yahoo! Auctions!
        http://auctions.yahoo.com
      Your message has been successfully submitted and would be delivered to recipients shortly.