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

Dispatching to module that has access to soap envelope

Expand Messages
  • Nils Sowen
    hello everybody - i use SOAP::Transport::HTTP::Daemon as my soap-server, it s supposed to dispatch all request to a certain perl module. now i got the problem
    Message 1 of 2 , Sep 10, 2004
    View Source
    • 0 Attachment
      hello everybody -

      i use SOAP::Transport::HTTP::Daemon as my soap-server, it's
      supposed to dispatch all request to a certain perl module.

      now i got the problem that i want use this particular module from
      regular, local perl-scripts, too, so i have to do some checks in the
      functions:

      ---

      package MyModule;
      @MyModule::ISA = qw(SOAP::Server::Parameters);

      sub myFunction() {
      my $this = shift;
      my $SOAP_envelope = pop;
      my $value;
      if ($SOAP_envelope) {
      $this->init() if (!$this->{inited});
      $value = $SOAP_envelope->valueof("//myValue");
      print "Value: $value\n";
      } else {
      $value = shift;
      print "Value: $value\n";
      }
      }

      ---

      i know that this won't work, because if we do a regular local function
      call, the value i look for in the else-part ist already taken by the
      variable $SOAP_envelope.

      is there any way to check whether i got a real envelope, like checking
      if $SOAP_envelope is an instance of SOAP::SOM or whatever?

      e.g. something like....
      [...]
      my $this = shift;
      my $last_argument = pop;
      my $value;
      if (isInstanceOfSOAP::SOM($last_argument)) {
      $value = $SOAP_envelope->valueof("//myValue");
      } else {
      $value = $last_argument;
      }
      [...]

      or does anybody have a even better idea, because i think this is quite
      messy, too...

      byebye,
      nils
    • Mark Fuller
      ... Try print ref($SOAP_envelope); When I do it on a SOM object it tells me it is a reference to SOAP::Data . Mark _______________________________ Do you
      Message 2 of 2 , Sep 10, 2004
      View Source
      • 0 Attachment
        --- Nils Sowen <n.sowen@...> wrote:
        > is there any way to check whether i got a real
        > envelope, like checking
        > if $SOAP_envelope is an instance of SOAP::SOM or
        > whatever?

        Try "print ref($SOAP_envelope);" When I do it on a SOM
        object it tells me it is a reference to "SOAP::Data".

        Mark



        _______________________________
        Do you Yahoo!?
        Shop for Back-to-School deals on Yahoo! Shopping.
        http://shopping.yahoo.com/backtoschool
      Your message has been successfully submitted and would be delivered to recipients shortly.