Hi,
I have a question that I hope will be simple for someone to answer.
I am using soap4r to write a simple library to consume web services from
an application. The application does not include a WSDL document, so I
have to write everything by hand.
The application requires attributes in certain elements of the soap
request, and I am having a little trouble figuring out how to do this.
So far, a portion of my test code looks like this:
driver = SOAP::RPC::Driver.new(endpoint, 'urn:namespace')
driver.add_method_as('get_account', 'GetAccountRequest', 'account')
get_account = driver.get_account('user@example.com')
which produces this:
<n2:GetAccountRequest xmlns:n2="urn:namespace"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<account xsi:type="xsd:string">user@example.com</account>
</n2:GetAccountRequest>
but I need the soap request to look like this:
<n2:GetAccountRequest xmlns:n2="urn:namespace"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<account by="name" xsi:type="xsd:string">user@example.com</account>
</n2:GetAccountRequest>
with the by="name" attribute in the account element.
I've been experimenting with SOAP::Mapping::Registry to achieve this,
but I am not sure how it would be done, or even if this is the correct
approach to take. If anyone can offer any assistance, it would be
appreciated.
Thanks,
Andrew
···
--
Posted via http://www.ruby-forum.com/.