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

when is a ->call(Method) not a ->Method call?

Expand Messages
  • Mark Wilkinson
    Dear Group, I have lurked long enough :-) I have hit a problem that I can t find an answer to in the archives, so I joined in the hopes that someone out there
    Message 1 of 3 , Oct 31, 2001
    • 0 Attachment
      Dear Group,

      I have lurked long enough :-)

      I have hit a problem that I can't find an answer to in the archives, so
      I joined in the hopes that someone out there can clarify something that
      has bugged me for the past few weeks. The SoapLite documentation it
      implies that these two statements are identical:

      $service->Method(@args);
      $service->call("Method" => @args)->result;

      I am using a service as defined by a WSDL document. For me, the former
      of these two statements works just fine, but the latter does not. I
      *need* the latter to work because I need to get my hands on the SOM that
      comes back from the method call, and the first statement does not return
      a SOM.

      The docs suggest that perhaps the uri is not passed in a ->call, so I
      have also tried:

      $service->call(SOAP::Data->name('Method')->attr({xmlns =>
      'http://localhost/cgi-bin/MOBY/SR'})=>@args);

      where my script is in cgi-bin, and the script calls
      ->dispatch_to("MOBY::SR"), and there is an executable perl module SR.pm
      in the /cgi-bin/MOBY/ folder. This also fails.

      The error I get is always the same: Can't call send_recieve on an
      undefined value.

      So... I'm totally lost! It seems that these two calls are *not*
      identical... or am I missing something?

      Anyone have any ideas?

      cheers!

      M


      --
      --------------------------------
      "Speed is subsittute fo accurancy."
      ________________________________

      Dr. Mark Wilkinson
      Bioinformatics Group
      National Research Council of Canada
      Plant Biotechnology Institute
      110 Gymnasium Place
      Saskatoon, SK
      Canada
    • Paul Kulchenko
      Hi, Mark! ... I think it s too long ;) ... hm, I wouldn t say that. It s little bit more complicated. $soap = SOAP::Lite- proxy(...)- uri();
      Message 2 of 3 , Oct 31, 2001
      • 0 Attachment
        Hi, Mark!

        --- Mark Wilkinson <mwilkinson@...> wrote:
        > I have lurked long enough :-)
        > has bugged me for the past few weeks. The SoapLite documentation
        I think it's too long ;)

        > implies that these two statements are identical:
        >
        > $service->Method(@args);
        > $service->call("Method" => @args)->result;

        hm, I wouldn't say that. It's little bit more complicated.

        $soap = SOAP::Lite->proxy(...)->uri();
        $soap->Method(@args);
        $soap->call(Method => @args);

        *almost* identical (->call gives some advantages) as well as

        $soap->Method(@args)->result;
        $soap->call(Method => @args)->result;

        where both return *real* values (whereas code above returns SOM).

        now, this code works differently:

        $service = SOAP::Lite->service('http://....wsdl');
        $service->Method(@args); # returns *real* result
        $service->call(Method => @args); # isn't available in this case

        > *need* the latter to work because I need to get my hands on the SOM
        > that
        > comes back from the method call, and the first statement does not
        > return a SOM.
        You can still access SOM object using

        $service->call

        which returns SOM object that's the result of the last call.

        > The error I get is always the same: Can't call send_recieve on an
        > undefined value.
        btw, v0.52 producec different (better?) error in this case:

        "Transport is not specified (using proxy() method or service
        description)"

        Hope it helps.

        Best wishes, Paul.


        __________________________________________________
        Do You Yahoo!?
        Make a great connection at Yahoo! Personals.
        http://personals.yahoo.com
      • mwilkinson@gene.pbi.nrc.ca
        ... thank you for your welcome, and for your rapid reply! ... aha! So my last couple of weeks have been wasted trying to make something work that *can t* work
        Message 3 of 3 , Oct 31, 2001
        • 0 Attachment
          --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:

          > I think it's too long ;)

          thank you for your welcome, and for your rapid reply!


          > $service = SOAP::Lite->service('http://....wsdl');
          > $service->Method(@args); # returns *real* result
          > $service->call(Method => @args); # isn't available in this case

          aha! So my last couple of weeks have been wasted trying to make
          something work that *can't* work :-) Okay, next time I'll spend less
          time lurking and more time questioning!!

          > $service->call

          yeah, that's what I am doing... I just thought it was a bit "messy" to
          do it that way, and was wondering why I wasn't able to do it the other
          way.


          > "Transport is not specified (using proxy() method or service
          > description)"

          I had a feeling that this was a part of the problem. I had noticed
          that, although WSDL has a "slot" for transport in the soap:binding, it
          doesn't seem to make much difference what uri I put in there... so I
          assumed that it was ignored.

          Well, I'm relieved to have that all sorted out! I have one more
          problem, but I want to work on it myself for a while before I ask the
          group, otherwise I will never learn this stuff deeply...

          thanks Paul!

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