chuck son
chuck son

Reputation: 194

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]"

Upvotes: 4

Views: 2317

Answers (2)

RTIndy
RTIndy

Reputation: 148

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")

Upvotes: 5

chuck son
chuck son

Reputation: 194

Here's how to supply a dynamic user/pw:

client.http.auth.basic "username", "password"

Make sure to modify your "soap:address location" node value back to just "https://example.com".

Upvotes: 0

Related Questions