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

1656Re: [soaplite] Re: Calling a web service - please help

Expand Messages
  • Duncan Cameron
    Jun 28, 2002
    • 0 Attachment
      On 2002-06-28 soapnewby wrote:
      >Now I get "Soap call failed: 405 Method not allowed. "
      >
      >Does anyone have an example code snippet of a client calling a web
      >service with .asmx extension?
      >
      >Thanks a lot!
      >Lana
      >
      >
      >
      >--- In soaplite@y..., rjray@b... wrote:
      >> >>>>> "sergei" == sergei lana <soapnewby>
      >> >>>>> wrote the following on Thu, 27 Jun 2002 20:41:04 -0000
      >>
      >> sergei> I don't get any error messages but the thing just doesn't
      >work. :( I
      >> sergei> tested the web service itself and it works OK.
      >>
      >> My guess is that like most .NET services, this one is very picky
      >about the
      >> naming and the namespaces of the arguments you pass to it. Consider
      >looking at
      >> the API documentation, then giving the parameters explicit names
      >and such by
      >> using SOAP::Data calls, rather than passing straight Perl data.
      >>
      >> And don't feel bad-- we all run into this. Perl is very liberal and
      >> accomodating in what it will accept as input, it's easy to forget
      >that most
      >> other languages aren't.
      >>
      >> Randy
      >> --
      >> """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
      >"""""""""""
      >> Randy J. Ray
      >rjray@b...
      >> Campbell, CA
      >rjray@s...
      >> <A HREF="http://www.svsm.org">Silicon Valley Scale Modelers</A>
      >

      I've been using SOAP::Lite clients to .Net services at work but won't
      be there until Monday ):

      From memory I use something like this (untested):

      $ns = 'your.services.namespace';
      $soap = SOAP::Lite
      ->uri($ns)
      ->proxy('http://somewhere/xxx.asmx')
      ->on_action(sub {join('/', @_)});

      my $method = SOAP::Data->attr({xmlns => $ns}, 'MyMethod');

      my $r = $soap->call($method,
      SOAP::Data->name(p1 => 23)->type('int'),
      SOAP::Data->name(p2 => 'abcd')->type('string')
      };

      I found that it was essential to have the correct namespace and
      types.

      Regards,
      Duncan Cameron
    • Show all 10 messages in this topic