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

beginner's question/Is this a proper SOAP Envelope?

Expand Messages
  • vanvuure <marcel_van_vuure@hotmail.com>
    Hi, I have an existing soap client and for that client, I have to build a soap server. I m building the server in SOAP::Lite. The client has already been built
    Message 1 of 1 , Feb 3, 2003
    • 0 Attachment
      Hi,

      I have an existing soap client and for that client, I have to build a
      soap server. I'm building the server in SOAP::Lite. The client has
      already been built in another language and the code can not be
      changed.
      From the documentation I know that the client calls a function
      OpenSession on the server with 3 parameters: session_key username and
      password.
      Based on this information I wrote the soap server:

      #!perl -w

      use SOAP::Transport::HTTP;
      #use Demo;

      # don't want to die on 'Broken pipe' or Ctrl-C
      $SIG{PIPE} = $SIG{INT} = 'IGNORE';
      my $daemon = SOAP::Transport::HTTP::Daemon
      -> new (LocalPort => 80)
      -> dispatch_to('Demo')
      ;
      print "Contact to SOAP server at ", $daemon->url, "\n";
      $daemon->handle;

      package Demo;
      sub OpenSession {
      my ($class, $key, $name, $password) = @_;
      print("session_key = $key, username = $name, password =
      $password\n");
      my $id = 2;
      return($id);
      }

      When I tested it to work with the client, it doesn't seem to pick up
      the parameters correctly. Although the OpenSession subroutine is
      called on the server, the parameters have the wrong values:

      The first parameter ($key), has a piece of xml as a value and the
      other 2 parameters have no value at all. The print command gives:

      session_key = <?xml version="1.0" encoding="UTF-8" ?>
      <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-
      instance" xs
      i:noNamespaceSchemaLocation="OpenSession.xsd">
      <session key="marcel" />
      <user name="van vuure" password="holland" />
      </request>
      , username = , password =

      The xml sent by the non-SOAP::Lite client to the server looks like
      this:

      <soap:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="
      http://www.w3.org/1999/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <OpenSession xmlns="Demo">
      <xmlin xsi:type="xsd:string"><?xml version="1.0"
      encoding="UTF-8" ?>
      <request
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="OpenSession.xsd">
      <session key="marcel" />
      <user name="van vuure"
      password="holland" />
      </request>
      </xmlin></OpenSession>
      </soap:Body>
      </soap:Envelope>


      Is this a proper SOAP envelope? Am I not picking up the input
      parameters in the right way in the server? What shoud the server look
      like to receive this as a functioncall to OpenSession with parameters
      session key, user name and password?

      I hope somebody can help me with this.

      Thanks,

      Marcel van Vuure
    Your message has been successfully submitted and would be delivered to recipients shortly.