# Implementing ruby webservice after having used wsdl2ruby

**URL:** <https://www.ruby-forum.com/t/implementing-ruby-webservice-after-having-used-wsdl2ruby/196750>\
**Category:** Ruby\
**Created:** [July 21, 2008, 8:15am UTC](https://www.ruby-forum.com/t/implementing-ruby-webservice-after-having-used-wsdl2ruby/196750 "2008-07-21T08:15:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmvipin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/c0e974/32.png) [@vmvipin](https://www.ruby-forum.com/u/vmvipin)\
**Post date:** [July 21, 2008, 8:15am UTC](https://www.ruby-forum.com/t/implementing-ruby-webservice-after-having-used-wsdl2ruby/196750/1 "2008-07-21T08:15:31Z")

</div>

Hi All,

One of our client had created a WSDL in ASP and sent it over asking us  
to implement the same structure in ruby. I created server and client  
files (4 files each) using these commands

wsdl2ruby.rb â€“wsdl /home/Test.wsdl â€“type server â€“force  
wsdl2ruby.rb â€“wsdl /home/Test.wsdl â€“type client â€“force

My questions are :-

1. how can i create WSDLs automatically like in AWS -  
[http://localhost:3000/test/wsdl/](http://localhost:3000/test/wsdl/)  
?  
(saw this post but not able to make it  
[SOAP::RPC::StandaloneServer and WSDLs - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/145717#704459))

2. Am able to run the server app. But when am sending the request from  
client its shows error like  
" ERROR – Test: GET request not allowed " (am getting this same error  
when i try http://localhost:3000test/wsdl/)

3. Am calling my client like this  
driver = SOAP::WSDLDriverFactory.new(url).create\_rpc\_driver  
result = driver.method(arg)

but am getting an error like this :-  
RuntimeError (Unexpected response: #\<HTTP::Message::Headers:0x23d2f28  
@request\_via\_proxy=nil, @is\_request=false, @response\_status\_code=405,  
@body\_charset=nil, @request\_query=nil, @request\_method=nil,  
@header\_item=[[“Connection”, “close”], [“Date”, “Sat, 19 Jul 2008  
09:26:32 GMT”], [“Content-Type”, “text/html”], [“Server”, “WEBrick/  
1.3.1 (Ruby/1.8.6/2008-03-03)”], [“Content-Length”, “297”], [“Allow”,  
“POST”]], @body\_type=nil, @request\_uri=nil, @body\_date=nil,  
@http\_version=“1.1”, @reason\_phrase="Method Not Allowed ",  
@chunked=false, @body\_size=0\>):  
/Library/Ruby/Gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb:  
2058:in `follow_redirect' /Library/Ruby/Gems/1.8/gems/httpclient-2.1.2/lib/httpclient.rb: 1890:in `get\_content’  
/Library/Ruby/Gems/1.8/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/  
importer.rb:73:in `fetch' /Library/Ruby/Gems/1.8/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/ importer.rb:36:in `import’  
…  
…  
…

i have already added these lines in my env.rb

require ‘rubygems’  
gem ‘soap4r’

then what could be wrong?

am using  
ruby - 1.8.6  
soap4r - 1.5.8  
mac-os leopard

Thanks in advance 🙂

Vipin

---

<div class="post-metadata">

**Author:** ![vmvipin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/c0e974/32.png) [@vmvipin](https://www.ruby-forum.com/u/vmvipin)\
**Post date:** [July 21, 2008, 12:16pm UTC](https://www.ruby-forum.com/t/implementing-ruby-webservice-after-having-used-wsdl2ruby/196750/2 "2008-07-21T12:16:32Z")

</div>

Vipin Vm wrote:

> SOAP::WSDLDriverFactory.new(url).create\_rpc\_driver result =  
> @reason\_phrase="Method Not Allowed ",

The headers show you that only POST methods are allowed (the

[“Allow”,“POST”]).  
From your tests and what you write I guess the RPC driver is making GET  
requests.

You’ll have to check the generated code and/or twiddle the properties  
when you generate your driver.  
Without code and without looking into the soap4r stuff I can’t say much  
more  
Cheers,  
V.-

---

<div class="post-metadata">

**Author:** ![vmvipin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/c0e974/32.png) [@vmvipin](https://www.ruby-forum.com/u/vmvipin)\
**Post date:** [July 21, 2008, 12:54pm UTC](https://www.ruby-forum.com/t/implementing-ruby-webservice-after-having-used-wsdl2ruby/196750/3 "2008-07-21T12:54:48Z")

</div>

Hi Vassilis R.,

As i mentioned earlier… i have created 4 sever & client files from a  
WSDL. Am able to start my StandaloneServer app. But the client is not  
working. am getting this error

/Library/Ruby/Gems/1.8/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:268:in  
`send_post': 404: Not Found (SOAP::HTTPStreamError) from /Library/Ruby/Gems/1.8/gems/soap4r-1.5.8/lib/soap/streamHandler.rb:172:in`send’  
from  
/Library/Ruby/Gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:179:in  
`route' from /Library/Ruby/Gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:143:in`call’  
from  
/Library/Ruby/Gems/1.8/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:181:in  
`call’

is there any way to see the WSDLs when we use wsdl2ruby?

thanx 🙂

Vipin

Vassilis R. wrote:

> Vipin Vm wrote:
> 
> > SOAP::WSDLDriverFactory.new(url).create\_rpc\_driver result =  
> > @reason\_phrase="Method Not Allowed ",
> 
> The headers show you that only POST methods are allowed (the
> 
> [“Allow”,“POST”]).  
> From your tests and what you write I guess the RPC driver is making GET  
> requests.
> 
> You’ll have to check the generated code and/or twiddle the properties  
> when you generate your driver.  
> Without code and without looking into the soap4r stuff I can’t say much  
> more  
> Cheers,  
> V.-

---

<div class="post-metadata">

**Author:** ![vmvipin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/c0e974/32.png) [@vmvipin](https://www.ruby-forum.com/u/vmvipin)\
**Post date:** [July 22, 2008, 10:33am UTC](https://www.ruby-forum.com/t/implementing-ruby-webservice-after-having-used-wsdl2ruby/196750/4 "2008-07-22T10:33:20Z")

</div>

Vipin Vm wrote:

> `send’  
> is there any way to see the WSDLs when we use wsdl2ruby?

I can’t really help you with the wsdl’s since I avoid them like the  
plague - too much work for too little benefit.  
From the error above it seems like the client is looking for the wrong  
URL (that 404 HTTP return code there)  
If I was you I’d go in there with the debugger or with a few log  
messages and figure out which URL is called and how.  
Cheers,  
V.-
