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

Re: SOAP::Lite +wsdl in a object-oriented way

Expand Messages
  • and11_bf
    ... Sorry, I ve sent prev. message to the wrong address. Thanks fore reply. Anyway, this is not what I m looking for. $service- someMethod( $someParam,
    Message 1 of 4 , Mar 5 4:11 PM
    • 0 Attachment
      --- In soaplite@yahoogroups.com, jmzorko@m... wrote:
      >
      > Andrew,
      >
      > > use SOAP::Lite;
      > > print SOAP::Lite
      > > ->
      > > service('http://www.xmethods.net/sd/StockQuoteService.wsdl')
      > > -> getQuote('MSFT');
      >
      > Is this better?
      >
      > my $success = eval
      > {
      > my $service = SOAP::Lite->service( "uri://to.WSDL.file" );
      > $service->someMethod( $someParam, @someArrayOParams );
      > };
      >
      > Regards,
      >
      > John
      >
      > Falling You - exploring the beauty of voice and sound
      > New album, "Touch", available now
      > http://www.magnatune.com/artists/falling_you

      Sorry, I've sent prev. message to the wrong address.
      Thanks fore reply. Anyway, this is not what I'm looking for.

      $service->someMethod( $someParam, @someArrayOParams );

      Code above calls someMethod as a class method rather than object's one.
      I.e. I'd like to have object initialized (I also waht to be able to
      pass some args. into class' constructor), something like this:

      $obj = $service->SOAP::new('args');
      $obj->someMethod(11).

      I know it is possible without using WSDL thi way:

      $service = SOAP::Lite->proxy(..)->uri(..);
      $obj = $service->call(new => 'args')->result;
      $obj->someMethod('xx');

      But I didn't see any directions on using such things with WSDL. All I
      saw is just a phrases about that in this case $service is not a
      SOAP::SOM. So, does it mean that I can't get object reference while
      using WSDL?


      Please advise.
      Thanks, Andrew
    • Duncan Cameron
      ... I don t think this will do what you are claiming. $obj will just be a variable in your client, it will not have any reference to a remote object. You still
      Message 2 of 4 , Mar 6 12:43 AM
      • 0 Attachment
        On 2005-03-06 at 00:11:13 and11_bf wrote:

        >--- In soaplite@yahoogroups.com, jmzorko@m... wrote:
        >>
        >> Andrew,
        >>
        >> > use SOAP::Lite;
        >> > print SOAP::Lite
        >> > ->
        >> > service('http://www.xmethods.net/sd/StockQuoteService.wsdl')
        >> > -> getQuote('MSFT');
        >>
        >> Is this better?
        >>
        >> my $success = eval
        >> {
        >> my $service = SOAP::Lite->service( "uri://to.WSDL.file"
        >>);
        >> $service->someMethod( $someParam, @someArrayOParams );
        >> };
        >>
        >> Regards,
        >>
        >> John
        >>
        >> Falling You - exploring the beauty of voice and sound
        >> New album, "Touch", available now
        >> http://www.magnatune.com/artists/falling_you
        >
        >Sorry, I've sent prev. message to the wrong address.
        >Thanks fore reply. Anyway, this is not what I'm looking for.
        >
        >$service->someMethod( $someParam, @someArrayOParams );
        >
        >Code above calls someMethod as a class method rather than object's
        >one.
        >I.e. I'd like to have object initialized (I also waht to be able to
        >pass some args. into class' constructor), something like this:
        >
        >$obj = $service->SOAP::new('args');
        >$obj->someMethod(11).
        >
        >I know it is possible without using WSDL thi way:
        >
        >$service = SOAP::Lite->proxy(..)->uri(..);
        >$obj = $service->call(new => 'args')->result;
        >$obj->someMethod('xx');

        I don't think this will do what you are claiming. $obj will just be a
        variable in your client, it will not have any reference to a remote
        object. You still need to do
        $soap->someMethod($obj, 'xx');
        to pass the object back to the remote system.
        >
        >But I didn't see any directions on using such things with WSDL. All I
        >saw is just a phrases about that in this case $service is not a
        >SOAP::SOM. So, does it mean that I can't get object reference while
        >using WSDL?
        >
        Using WSDL you can get the SOAP::SOM object from the most recent call
        by

        my $result = $service->someMethod();
        my $som = $service->call;

        The 'O' in SOAP stopped meaning 'Object' a long time ago. It is
        probably best to treat SOAP as a mechanism for RPC and for
        transferring XML documents. It is not a way of handling remote
        objects.
        S::L does provide some support for that though using 'autodispatch',
        but that will only be of use when both client and server are written
        in perl.

        Regards
        Duncan
      Your message has been successfully submitted and would be delivered to recipients shortly.