I need to create a ruby web service client (with Savon) in order to make a soap call to a web service that requires EncodingType in Nonce. So, the correct soap message will have a Nonce element as follows:
......
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">SomeHashValue</wsse:Nonce>
......
But in my Savon client, I do not know how to add this attribute to the Nonce element. My code is here:
......
client = Savon.client do
wsdl.endpoint = "http://webservicehost/TestWebService"
wsdl.namespace = "namespace"
wsse.credentials "username", "password"
wsse.digest = "true"
end
client.request :get_service do |soap|
soap.input = [
"GetService",
{ "xmlns" => "namespace" }
]
soap.body = {
"locale" => "en_US",
"serviceID" => '123'
}
end
......
Nonce in the generated SOAP message looks like this:
......
<wsse:Nonce>SomeHashValue</wsse:Nonce>
......
So my question is how to add the EncodingType attribute to the Nonce element without changing / removing SomeHashValue in the Nonce element?
source
share