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

FW: Access to SOM object within the server?

Expand Messages
  • Thomas Eden
    On the server side, assuming myMethod is the called method: sub myMethod { my $self = shift; # get rid of class/object reference my $som = pop; # grab the
    Message 1 of 2 , Sep 30, 2005
    • 0 Attachment
      On the server side, assuming myMethod is the called method:

      sub myMethod {
      my $self = shift; # get rid of class/object reference
      my $som = pop; # grab the SOAP::SOM object

      if ( $som->valueof( 'Body' ) ) {
      ...
      }
      };


      -----Original Message-----
      From: MikeG [mailto:mike@...]
      Sent: Friday, September 30, 2005 04:06
      To: teden
      Subject: Re: Access to SOM object within the server?

      I see what you mean but I just can't figure out how to get hold of $som to
      do this. I've tried doing shift's from @_ in various contexts but it isn't
      working for me.

      Thanks
      Mike

      teden wrote:

      >You need to iterate over the input. Try
      >
      >if ( $som->valueof( 'Body' ) ) {
      > foreach my $importId( $som->dataof( '//importId/*' ) ) {
      > my $val = $importId->value;
      > }
      >}
      >
      >Thom
      >
      >--- In soaplite@yahoogroups.com, "shadowfoo2" <mike@m...> wrote:
      >
      >
      >>Hi
      >>I'd like to get access to the SOM object in the server so that I can
      >>see the name of the first level element in the message body and to
      >>iterate over an array of elements having the same name.
      >>
      >>I.e. read out the list of import and export ids from the following
      >>call to the server:
      >>
      >><SOAP-ENV:Body>
      >><namesp1:status xmlns:namesp1="snapshot"> <importId
      >>xsi:type="xsd:int">1</importId> <importId
      >>xsi:type="xsd:int">2</importId> <importId
      >>xsi:type="xsd:int">4</importId> <exportId
      >>xsi:type="xsd:int">1</exportId> <exportId
      >>xsi:type="xsd:int">2</exportId> </namesp1:status> </SOAP-ENV:Body>
      >>
      >>The best I can do so far is if the request is nested one level
      >>
      >>
      >deeper.
      >
      >
      >> Then the second arguement to the server functions is a hash. But
      >>since a hash can only have unique keys I can only see one of each
      >>
      >>
      >type.
      >
      >
      >>Thanks
      >>MikeG
      >>
      >>
      >
      >
      >
      >
    • Jay A. Kreibich
      ... Don t forget that this only works if the package myMethod has the package SOAP::Server::Parameters somewhere in its @ISA tree. This is what causes the
      Message 2 of 2 , Sep 30, 2005
      • 0 Attachment
        On Fri, Sep 30, 2005 at 07:50:37AM -0400, Thomas Eden scratched on the wall:
        > On the server side, assuming myMethod is the called method:
        >
        > sub myMethod {
        > my $self = shift; # get rid of class/object reference
        > my $som = pop; # grab the SOAP::SOM object
        >
        > if ( $som->valueof( 'Body' ) ) {
        > ...
        > }
        > };

        Don't forget that this only works if the package myMethod has the
        package "SOAP::Server::Parameters" somewhere in its @ISA tree. This
        is what causes the SOM object to be appended to the function
        parameters.

        -j

        --
        Jay A. Kreibich | CommTech, Emrg Net Tech Svcs
        jak@... | Campus IT & Edu Svcs
        <http://www.uiuc.edu/~jak> | University of Illinois at U/C
      Your message has been successfully submitted and would be delivered to recipients shortly.