Perl - Problem with method name in the SOAPAction, using SOAP::Lite module
Bruno Baguette <[email protected]> Fri, 5 Nov 2004 13:14:49 -0500
| Newsgroups | gmane.comp.windows.devel.soap.general |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Hello, I have a problem with a SOAP client written in Perl (source at the end). I've tried both ways (by commenting TRIAL ONE or SECOND TRIAL), and I get exactly the same results. When I see the trace of that script, I notice that there is a # sign before the method I try to invoque. I think that that # sign may be responsible of the SOAP error I get : System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: #GetProperties. If I see the trace of the SOAP::Lite module, I see that it send #GetProperties instead of GetProperties : SOAPAction: "http://schemas.dataswitch.be/service/2.7/export/#GetProperties" Is there a way to avoid that # sign in the sent SOAPAction by the SOAP::Lite module ? Thanks _very_ much in advance for your help ! -- Bruno BAGUETTE - [email protected] ==== CODE ==== use SOAP::Lite +trace; use strict; # Skarabee userid/passwd my $UserId = "xxx"; my $Password = "xxx"; my $PropertiesList; sub SOAP::Transport::HTTP::Client::get_basic_credentials { return ($UserId => $Password) }; my $SOAPService = new SOAP::Lite(); $SOAPService->service('file:./myfile.wsdl'); $SOAPService->proxy('http://www.HOSTNAME.be/service/v27/export.asmx'); $SOAPService->on_fault(sub { my($soap, $res) = @_; die ref $res ? $res->faultstring : $soap->transport->status, "\n"; }); # TRIAL ONE $PropertiesList = $SOAPService -> GetProperties(Token =>0) -> result(); print('Results : ['.$PropertiesList.']'); # SECOND TRIAL my $response = $SOAPService ->call(SOAP::Data->name('GetProperties') ->attr( { xmlns => 'http://www.HOSTNAME.be/service/2.7/export/' } ) => # Argument(s) listed next SOAP::Data->name(Token => 0)); if ($response->fault) { printf "A fault (%s) occurred: %s\n", $response->faultcode, $response->faultstring; } else { print "Resultats : [" . $response->result ."]\n"; } ==== CODE ====