Search code examples
soapsavon

Overriding a WSDL's "soap:address location" value?


Is it possible to override the "address location" value in a WSDL? I need to supply a dynamic user/password within the URL.

This certainly doesn't work:

client = Savon::Client.new("example.wsdl")
client.http.url = "https://foo:[email protected]"

Solution

  • If you're actually just trying to change the URL, this worked for me:

    client = Savon::Client.new("example.wsdl")
    client.wsdl.endpoint = URI.parse "https://example.com"
    

    In newer versions of Savon it can be provided via configuration option:

    client = Savon::Client.new(wsdl: "example.wsdl",
                               endpoint: "https://example.com")