from soap4r-ml:
The SOAP service that i am trying to connect to uses attributes that
are in a specified namespace:
...
<env:Body>
<gno:getHealthSummary xmlns:gno='http://some.url'>
<gno:account gno:id='1234' />
</gno:getHealthSummary>
</env:Body>
...
It is my understanding that soap4r does not support attributes with
namespaces, but i need to communicate with this service. Short of
writing my own SOAP API is there anything I can do? It appears to
work when i do this:
require 'soap/rpc/driver'
driver = SOAP::RPC::Driver.new('http://some.url/report.pl', 'http://
some.url')
driver.wiredump_dev = STDERR if true # $DEBUG
method = [ "http://some.url/getHealthSummary",
"getHealthSummary",
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://
some.url", "getHealthSummary"], true],
["out", "parameters", ["::SOAP::SOAPElement", "http://
some.url", "getHealthSummaryResponse"], true] ],
{ :request_style => :document, :request_use => :literal,
:response_style => :document, :response_use => :literal }
];
driver.add_document_operation(*method);
methodElement = SOAP::SOAPElement.new(XSD::QName.new("http://
some.url", "getHealthSummary"));
methodElement.extraattr['xmlns:gno'] = 'http://some.url';
account = SOAP::SOAPElement.new(XSD::QName.new("http://some.url",
"account"));
account.extraattr["gno:id"] = 1;
methodElement.add(account);
puts 'getHealthSummary';
results = driver.getHealthSummary(methodElement);
p results;
But it is a huge hack in that i have to put the namespace in as an
attribute on the containing element and give the id a pre-prefixed
name.