Welcome Guest | Login

Using Web Services Description Language, wsdl2ruby and soap4r as a client

I am trying to integrate my state's tax rate wsdl with my shopping cart.  I have been trying to follow the information at this link: http://www.brendonwilson.com/blog/2006/04/02/ruby-soap4r-wsdl-hell/

I am unable to use wsdl2ruby.rb.

Can you tell me what I am doing wrong?  
:)
Thanks,
Jee

2007-03-13 08:43 PM

Life is too short for this ...
Hi,

Are you getting any error messages ? If so please paste it for further checking.

Also let us know how you are trying to run wsdl2ruby.



2007-03-14 02:15 AM

OK, sorry for the brevity, I was sort of hoping William would pop up and tell me I should do it some other easier, better way!  
So ...
Initially, I was working with the cli on my windows box and trying to follow the instructions in the link in my first post.  wsdl2ruby did seem to work there.  It created some files and they sort of made sense, then when I tried to actually connect to the tax service, the errors I got seemed like they might be corrected if I was actually on the live server, so I zipped up my app, uploaded it to hostingrails.com and deployed it successfully.

Then I SSH'ed into the server and started over at the beginning of the tutorial.
When I tried the following line:
wsdl2ruby.rb --wsdl http://services.taxwatch.biz/rates/kansas/sstp.wsdl --type client --force

-jailshell: wsdl2ruby.rb: command was not found

I'm guessing I am out of line somewhere, just need some guidance!
Thanks,
Jee

2007-03-14 12:16 PM

Life is too short for this ...
Hi Jee, try doing a quick

chmod 755 wsdl2ruby.rb

and
./wsdl2ruby.rb --wsdl http://services.taxwatch.biz/rates/kansas/sstp.wsdl --type client --force
As long as the shebang line of the file points to /usr/local/bin/ruby then it will execute the file no matter what's in it and look for ruby code.  :)  

Let me know how it goes.  

Cheers,  

~William

2007-03-14 02:13 PM

William,
I get the following when I chmod 755 wsdl2ruby.rb
  chmod: cannot access 'wsdl2ruby.rb': No such file or directory
this also happens with ./wsdl2ruby.rb
??
Jee

2007-03-19 02:26 PM

Life is too short for this ...
Are you sure you're running that from the correct directory? -- where is wsdl2ruby.rb located?  Why are you trying to run it from the command line?  

2007-03-19 03:08 PM

Arrghhhh..
I created a reply yesterday and apparently never completed submitting it!  I have been sitting around wondering why you weren't responding.  Duh...

So, No, I am not sure I am running it from the correct directory.  I don't know where it is located on your server.  It is located at c:\ruby on my winbox.  I am only trying to run it from the CLI because I thought I was supposed to do so.  The tutorial I found wasn't specific and I couldn't imagine where else I should run a command with that structure.

As always, your guidance is most appreciated!
Jee

2007-03-20 01:33 PM

Life is too short for this ...
Hmm - I'm afraid we're not going to be much help on this one.  You should check with others around the Net who are trying to accomplish the same task.  If you paste in other other URLs we can help you track em down.  There is likely a simpler way to accomplish this via rails and not having to make a system call....

2007-03-20 02:29 PM

Update:
I got this working.  For the sake of posterity, I thought I should expand on what I needed to do.
In the very first post, I listed the link I was following.  
The trick to making that tutorial work is that you run wsdl2ruby within your development NOT on your hosting server.  In my windows box it is in the c:\ruby file.  I ran the command FROM the folder (eg c:\rails\railsapp\somesubfolder ) where I wanted the resulting files to be stored.  

Then I was able to go back to the tutorial and continue figuring out how to make my specific wsdl document work properly.  I strongly recommend using the code from your newly generated sample client (eg. the includes, obj, etc) in the controller/model/helper where you want to use the information you receive from the wsdl server.

Best of luck!
Jee

2007-04-12 11:28 AM

Life is too short for this ...

Hello Guest! In order to post you must be an active client with us, please log in or sign up today!