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

??? Receiving freeform SOAP message with no namespace

Expand Messages
  • ggib23
    I m working with a company who is sending freeform Soap messages. They will not be including any Soap namespace or methods like this:
    Message 1 of 1 , Jun 18, 2003
    • 0 Attachment
      I'm working with a company who is sending freeform Soap messages.
      They will not be including any Soap namespace or methods like this:

      <namesp1:testMethod xmlns:namesp1="Gtest">
      <c-gensym5 xsi:type="xsd:string">

      inside the SOAP-ENV:BODY tag, so I am trying to figure out
      how to use Soap::Lite to deserialize the raw xml into valid
      Soap Objects, so that I can process the message.


      I can read the raw xml from STDIN, but when I try to
      Deserialize it, I get a uri error in the Soap::lite
      package. Is this possible to do with Soap::Lite, or
      am I just going to have to build my own xml programs
      to create the SOAP response to send back to my client?
      Do you see anything( or several things) I am doing
      wrong?

      Here is my sample server code:
      #!/hildev/bin/perl -w

      use SOAP::Transport::HTTP;
      use Debug;

      Debug::Init( "Gdebug" );
      Debug::Suffix( ".dbg" );
      Debug::On();

      #read the entire SOAP, XML document in at one time
      my $input = readline(*STDIN);
      Debug::Print( "My readline = $input \n");

      my $envelope = SOAP::Deserializer($input);
      my $hdr = $envelope->headerof("//key");
      Debug::Print( "$hdr->name() = NAME");


      **************************************************************
      Here is my client code:
      ********************************************************
      #!/hildev/bin/perl -w

      use strict;
      use Net::Telnet;
      my $data = "";

      while( <STDIN> ) {
      $data = $_;

      my $conlength = length( $data );

      my $con = new Net::Telnet;

      $con->open(Host => $host,
      Port => $port);

      $con->print("POST $url HTTP/1.0");
      $con->print("Content-Length: $conlength\n");
      $con->print("$data\n");
      my $cnt = $con->print_length;
      print "I SENT $cnt Btyes Across\n";
      $con->print("");

      while(!$con->eof) {
      my $line = $con->getline;
      print "$line\n";
      }

      }

      **********************************************************************
      ****************************************
      Here is the XML that was sent: The actual file contains no new-line
      or carriage returns in the document, just 1 line.......
      *******************************************************
      <SOAP-ENV:Envelope
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
      encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <SOAP-ENV:Header>
      <key xsi:type="xsd:int">123456</key></SOAP-ENV:Header>
      <SOAP-ENV:Body><POS></POS></SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
    Your message has been successfully submitted and would be delivered to recipients shortly.