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

Re: [soaplite] Client : SOAPAction and "#" symbol

Expand Messages
  • Paul Kulchenko
    Hi, Aaron! This code works for me: my $s = SOAP::Lite- new(); $s- proxy( http://rpc.weblogs.com/weblogUpdates ); $s- on_action(sub{ /weblogUpdates });
    Message 1 of 2 , Oct 2, 2001
    • 0 Attachment
      Hi, Aaron!

      This code works for me:

      my $s = SOAP::Lite->new();
      $s->proxy("http://rpc.weblogs.com/weblogUpdates");
      $s->on_action(sub{'"/weblogUpdates"'});
      $s->ping(
      SOAP::Data->name(weblogname=>'Scripting News'),
      SOAP::Data->name(weblogurl=>'http://www.scripting.com/'),
      );

      You don't need to provide URI, because userland's server requires
      none. You need to provide on_action handler to specify SOAPAction.
      Notice that proxy is also different "/RPC/weblogUpdates" is for
      XMLRPC and "/weblogUpdates" is for SOAP protocol.

      If you want to provide on_action for all of your SOAP::Lite objects
      you can specify it globally:

      use SOAP::Lite
      on_action => sub{'"/weblogUpdates"'};

      > Tangentially related, I am not really sure how to deal with method
      > names that contain dots in SOAP::Lite.
      If in doubts you can always use 'call' syntax:

      $s->call('method.name', @parameters)

      and 'method.name' will look on wire exactly as specified.

      > Is the first part the URI
      > and the second the method name to pass the SOAP object?
      Not on client side. Similar logic works on server side and only for
      XMLRPC protocol, where request for a.b will be dispatched as call for
      method 'b' in class 'a' (a->b). You can alter this behavior if you
      want. Let me know if you have any other problems.

      Best wishes, Paul.

      --- Aaron of Montreal <aaron_of_montreal@...> wrote:
      > Hi all,
      >
      > I am trying to write a simple wrapper to call the weblogs.com
      > update
      > service using SOAP::Lite. Specifically, I want to call
      > the "weblogUpdates.ping" method, but I keep getting errors saying
      > the
      > server can't find a method named (pound-symbol + method-name).
      >
      > I have tried a variety of possible combinations, but I can't seem
      > to
      > figure out if this is a problem in my code or on the server side.
      >
      > I seem to be able to produce a valid SOAP request per the docs (see
      >
      > below) but the server keeps wigging out on the SOAPAction header
      > (see
      > also below).
      >
      > Tangentially related, I am not really sure how to deal with method
      > names that contain dots in SOAP::Lite. Is the first part the URI
      > and
      > the second the method name to pass the SOAP object?
      >
      > Any help would be very much appreciated. Thanks,
      >
      > ****
      >
      > http://www.soapware.org/weblogsCom
      >
      > ****
      >
      > use SOAP::Lite on_debug => sub{ print@_; };
      >
      > my $s = SOAP::Lite->new();
      > $s->proxy("http://rpc.weblogs.com/RPC/weblogUpdates");
      > $s->uri("/weblogUpdates");
      > $s->ping(weblogname=>$name,weblogurl=>$url);
      >
      > ****
      >
      > POST http://rpc.weblogs.com/RPC/weblogUpdates
      > Accept: text/xml
      > Accept: multipart/*
      > Content-Length: 689
      > Content-Type: text/xml; charset=utf-8
      > SOAPAction: "/weblogUpdates#ping"
      >
      > <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-
      > ENC="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-
      > ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-
      > ENV:Body><namesp1:ping xmlns:namesp1="/weblogUpdates"><c-gensym3
      > xsi:type="xsd:string">weblogname</c-gensym3><c-gensym5
      > xsi:type="xsd:string">Perlblog</c-gensym5><c-gensym7
      > xsi:type="xsd:string">weblogurl</c-gensym7><c-gensym9
      > xsi:type="xsd:string">http://www.nospum.net/perlblog</c-
      > gensym9></namesp1:ping></SOAP-ENV:Body></SOAP-ENV:Envelope>
      > HTTP/1.1 500 (Internal Server Error) Server Error
      > Connection: close
      > Date: Tue, 02 Oct 2001 14:36:30 GMT
      > Server: UserLand Frontier/7.0.1-WinNT
      > Content-Length: 555
      > Client-Date: Tue, 02 Oct 2001 14:37:21 GMT
      > Client-Peer: 64.75.32.138:80
      >
      > <?xml version="1.0"?>
      > <SOAP-ENV:Envelope SOAP-
      > ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
      > <SOAP-ENV:Body>
      > <SOAP-ENV:Fault>
      > <faultcode>SOAP-ENV:Client</faultcode>
      > <faultstring>Can't evaluate the
      > expression because the name "weblogUpdates#ping"
      > hasn't been defined.</faultstring>
      > </SOAP-ENV:Fault>
      > </SOAP-ENV:Body>
      > </SOAP-ENV:Envelope>
      >
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Listen to your Yahoo! Mail messages from any phone.
      http://phone.yahoo.com
    Your message has been successfully submitted and would be delivered to recipients shortly.