I am using SOAP::Lite to use a WSDL-defined webservice.
My request (that is working fine) is like that.
<soapenv:Envelope xmlns:soapenv="http://myabc">
<soapenv:Header/>
<soapenv:Body>
<foo>
<p1>max</p1>
<p2>frank</p2>
</foo>
....
My perl code.
my $service = SOAP::Lite->service ("http://mywsdl");
my $ret = $service->foo ("max", "frank");
That is working too.
But I like to name/address my parameters p1 and p2 to have more flexibility.
I tried it with a hash
my %params = (p1 => "max", p2 => "frank");
and also with SOAP::Data.
my @params = (
SOAP::Data->name (p1 => "max"),
SOAP::Data->name (p2 => "frank"));
But it is not working that way.
String value expected instead of
SOAP::Datareference
Any ideas how to name my parameters?
EDIT
I like to use wsdl service. So how do I know how the service functions expect their parameters?? Thats the core of my question. I thought about the naming of parameters for a workaround.
I don't think you can name the parameters if you create the stubs from the service descriptions by calling service().
If you want to assign values to the parameters, there is an example available on CPAN.
Function sayHello
SOAP request
You have to replace the value of
proxytohttp://mywsdl,nameandgivenNametop1andp2,sayHellotofooandurn:HelloWorldto your WSDLs namespace.I also recommend to check this. All the requests can be done without SOAP::Lite.