1

I am working with a complicated SOAP service and I was wondering if there is a ruby tool that allows you to generate proxy classes with all the methods pre-generated.

NetBeans does a pretty good job of providing intellisence for classes and I'd love to work with SOAP from Ruby like I used to work with SOAP from Java/C#

mikebz
  • 3,277
  • 8
  • 37
  • 50
  • I found this: https://github.com/mumboe/soap4r and there seems to have a wsdl2ruby.rb – mikebz Feb 03 '12 at 01:45
  • make that an answer and accept it. as far as i know, soap4r is the only tool to generate static code from a wsdl. – rubiii Feb 03 '12 at 17:26
  • I can't make something my own answer :) Maybe you can cut and paste and I will accept that as the answer. – mikebz Feb 03 '12 at 21:50
  • It's totally ok to answer your own question :) http://meta.stackexchange.com/questions/16930/is-it-ok-to-answer-your-own-question-and-accept-it – rubiii Feb 05 '12 at 15:02

2 Answers2

1

No but give Savonrb a shot. http://www.savonrb.com.

chuck son
  • 194
  • 2
  • 8
0

Soap4r looks like the only code that will autogenerate proxy classes.

Handsoap will generate stubs for your services but doesn't appear to generate proxy classes.

Savon, as far as I know, requires you to hand code everything. I hope they one day add a stub generator.

Soap4r usage to make proxy classes and service

console> gem install soap4r

console> wsdl2ruby.rb --wsdl yourWsdlFileOrAddress.wsdl --type client

Dot notation

If you don't want static classes (e.g. not using autocomplete or IDE error checking), but want to access your hashes using dot notation, you can use one of the methods presented in this question:

hash['key'] to hash.key in Ruby

This enables you to access a hash similarly to an object.

a = myHash[:someField] # the standard way
a = myHash.someField   # with hash to hash key function 
Community
  • 1
  • 1
Greg
  • 1,549
  • 1
  • 20
  • 34