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

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

Expand Messages
  • vanvuure <marcel_van_vuure@hotmail.com>
    Feb 3, 2003
    • 0 Attachment

      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
      From the documentation I know that the client calls a function
      OpenSession on the server with 3 parameters: session_key username and
      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";

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

      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
      <session key="marcel" />
      <user name="van vuure" password="holland" />
      , username = , password =

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

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

      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.


      Marcel van Vuure