Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a Ruby SOAP client without using a WSDL?

Tags:

soap

ruby

I need to write a soap client that is capable of sending and receiving soap messages.

This soap service does not have an associated WSDL file and soap4r and savon both seem to require one.

I have an example of what I need to do in Java, see the link below.

http://community.cecid.hku.hk/index.php/product/article/writing_hermes_2_ws_client_under_java/#ebms-2_0-sender-ws

I could use java for this, at this point it seems like it would be easier. However I personally prefer coding in ruby and our company has more ruby resources than java.

Can anyone confirm thats its possible to do something similar to java example in ruby without writing my own specialised soap library?. I need to be able to send a payload, which I believe is usually in the form of a soap attachment.

I am particularly interested in seeing soap4r examples that don't use a WSDL as I have had trouble finding any with google.

Any help much appreciated.

like image 315
user385693 Avatar asked Jul 07 '10 15:07

user385693


1 Answers

as of Savon v2, the syntax is slightly different

client = Savon.client do
  endpoint "http://example.com"
  namespace "http://v1.example.com"
end

http://savonrb.com/version2/client.html

like image 113
bimbom22 Avatar answered Sep 24 '22 17:09

bimbom22