Rewriting endpoint definition in Savon 2.3.3

91 views
Skip to first unread message

Thomas Ehardt

unread,
Feb 25, 2014, 1:00:46 PM2/25/14
to sav...@googlegroups.com
Let's say that the WSDL for the service I am calling has enpoint URLs with port 8243, and I need to change that port to 9443. I know that I can set the endpoint when creating the client:

client = Savon.client do
end

... but I'd rather simply re-write the endpoint. Is there a way to do this? Barring that, is there a way to get the endpoint definition if it is not explicitly set?

Steffen Roller

unread,
Feb 25, 2014, 1:37:50 PM2/25/14
to sav...@googlegroups.com
Yes, it's called variable :-)

port_number = 9443
endpoint = https://localhost:#{port_number}/services/MyService.MyServiceHttpsSoap11Endpoint"

client = Savon.client(
  endpoint: endpoint,
  namespace: namespace
  log: true,
  log_level: :debug,
  pretty_print_xml: true
)



--
You received this message because you are subscribed to the Google Groups "Savon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to savonrb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thomas Ehardt

unread,
Feb 25, 2014, 3:09:31 PM2/25/14
to sav...@googlegroups.com
... maybe I need to clarify what I'm trying to accomplish:
  • create a Savon.client object, giving it a WSDL URI
  • retrieve the endpoint(s) from the client object
  • rewrite the endpoint definition (e.g. changing port)
  • pass the new endpoint to the client object (if necessary)

Steffen Roller

unread,
Feb 25, 2014, 4:30:40 PM2/25/14
to sav...@googlegroups.com
I would create yet another client object with the retrieved data from the first one.
I wonder *why* you want to do all of this?

-st
Reply all
Reply to author
Forward
0 new messages