I am consuming webservices with Savon and the WSDL comes with 2 bindings. How do I specify which binding to use in Savon? One of them is http
and the other one is https.
I am trying to use the https
service.
The information on wsdl
<wsdl:service name="ExampleService">
<wsdl:port name="ES" binding="tns:ES">
<soap:address location="http://example.com/service.svc"/>
</wsdl:port>
<wsdl:port name="ES1" binding="tns:ES1">
<soap:address location="https://example.com/service.svc"/>
</wsdl:port>
</wsdl:service>
How do i use ES1? The code I am using now with savon is
require 'savon'
require 'httpclient'
wsdl = "https://example.com/Messages.wsdl"
driver = Savon::Client.new(wsdl)
response = driver.request "someAction"
When I am using soap4r, I can choose the binding using the following code:
require 'httpclient'
require 'soap/wsdlDriver'
wsdl = "https://example.com/Messages.wsdl"
soap_client = SOAP::WSDLDriverFactory.new(wsdl)
driver = soap_client.create_rpc_driver('ExampleService','ES1')