Ask a Question related to PERL Modules, Design and Development.
-
Bruno Baguette #1
SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring
[Also posted in comp.lang.perl.moderated]
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 !
==== 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_credentia ls { 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 ====
--
Bruno BAGUETTE - [email]bouchon@alussinan.org[/email]
S'i'n'a è'ne saquî qui n'doit nin mârtchi, è'n mârtch'rè nîn.
Bruno Baguette Guest
-
problem with SOAP::Lite and mod_perl
Hi, I'm stuck. I'm trying to connect to a simple SOAP service via SOAP::Lite, e.g. my $soap = SOAP::Lite->new (uri => $soapaction, proxy =>... -
Writing a HTML/ASP SOAP client for a SOAP::Lite destination
How would I go about writing a SOAP client in either HTML or classic asp? The SOAP "listener" was written in Perl with SOAP::Lite in Unix and I am... -
SOAP::Lite install problem
I am trying to install SOAP::Lite on a Sun box. I tried installing the module using the following command and got the error "don't know what it... -
SOAP::Lite XML-Problem
Hello, I am having difficulty figuring out how to create a multiref using SOAP::Lite. Below is an example of some code that I would like to... -
SOAP::Lite HELP!
I've written soap clients before but never anything this complicated. Here are the links PIRP: http://homer.meso.com/crap/PIRP_Schema_v1.xsd... -
Bas #2
Re: SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPAction string
Hi Bruno,
In article <2v1vp0F2fa8fhU1@uni-berlin.de>,
Bruno Baguette <bouchon@alussinan.org> wrote:
I had the same problem, the solution can be found quite easy using> 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 !
Google. One usefull url:
[url]http://www.dotnettalk.net/Calling__Net_web_service_using_a_PERL_client_-6[/url]
301906-1296-a.html
The gist of the solution is specifiying an on_action method that builds
the SOAPAction string:
use SOAP::Lite +trace => 'debug';
....
$SOAPService->on_action(sub{join '/',
'http://schemas.dataswitch.be/service/2.7/export', $_[1]});
....
This should build the right SOAPAction, look at the output to see the
actual value for SOAPAction being used to see if it's correct.
btw. you're probably using SOAP::Lite to talk to a .Net soap service,
there are more issues with this (you have to use named parameters for
instance). Check out
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsoap/h[/url]
tml/soapliteperl.asp for more.
Cheers,
Bas.
Bas Guest



Reply With Quote

