Rookie Ruby/Java developer consuming SOAP

Status
You're currently viewing only tuxaroni's posts. Click here to go back to viewing the entire thread.
Not open for further replies.

tuxaroni

Wise, Aged Ars Veteran
102
I apologize for dumping my not fully thought trough thoughts on you guys, but I hope to validate if I am on the right track.

At a customer we have a product that integrates against a Web Service. This solution is requested by other customers. Our product use the excellent Savon gem. Unfortunately (in my book) our current solution downloads the WSDL directly and there is no way of validating change in Web Service. Things either work or they brake unpredictable. The difference between working with SOAP messages in Ruby versus static typed languages is that we don't generate proxy classes. I tried to get around this by exporting the WSDL to disk with SoapUI, writing unit tests and mocking the service in Savon, but then I learned that Savon can't handle wsdl:import correctly. If I want to get around that, I assume I have to flatten the WSDL by hand - but I think that's asking to much if we need to do more than one or two integrations.

Instead I am thinking about moving the library to jRuby (Ruby on Java) and just generate Java proxy classes that I call from Ruby code.
  • Is this a good approach for consuming Web Services in "Ruby"?
  • Is it easy to call Java SOAP client and consume the Web Service response from jRuby?
  • I don't have experience with Java SOAP clients. If Web Service change, do we get good validation or error messages from client?

Thanks in advance.
 

tuxaroni

Wise, Aged Ars Veteran
102
[url=http:/civis/viewtopic.php?p=27674681#p27674681:11gzshs9 said:
koala[/url]":11gzshs9]However, you might consider fetching the WSDL regularly and raise an alarm if it changes. This should be pretty easy to implement.

Do you suggest just to temporally download the main WSDL file and do a md5 check on it or something like that?
 

tuxaroni

Wise, Aged Ars Veteran
102
Thanks for the feedback, especially Midlands long experience and weight on the topic was interesting to learn about. Strangely I did not find much help searching online for a solution and had to gather the pieces by myself. I ended up using JRuby and Apache Axis2 Java library, and it's feels very reliable. If I look past the initial struggle figuring out the jar dependencies and namespace confusion, working with a Java library in Ruby language is very pleasant. It's Java like, but with a friendlier syntax.

I don't see the problem, did you read the docs?

anyone providing an API has some sort of versioning going on. In the ruby world REST and json version is very simple, it's part of the path /api/v1/:controller/:method/:id

SOAP is a nasty beast but it's part of the schema, look for the UDDI block in a check_and_fail_gracefully call, if YOUR versioned ruby module does not see what it like, toss an exception and log.

I just generate the classes with Axis2 and it's solid. I don't get that reliability with MRI alternatives.
 
Status
You're currently viewing only tuxaroni's posts. Click here to go back to viewing the entire thread.
Not open for further replies.