Someone asked on the SOAP::Lite message board about how to specify multiple namespaces in a request. The following little code snippet answers that question. The trick is using the SOAP::Data->attr() subroutine...
The following code snippet shows how to specify an additional namespace. It is easy - in fact anytime you need to specify additional attributes for an XML element in SOAP::Lite, just use the SOAP::Data->attr() subroutine like so:
my $method = SOAP::Data->name('methodName')
->attr({'xmlns:ns2' => 'urn:SecondaryNamespace'})
->prefix('ns1')
->uri('urn:PrimaryNamespace');
my $params = SOAP::Data->name('param' => '123');
my $results = $search->call($method => $params);
Comments