# Generating wsdl in ruby

**URL:** <https://www.ruby-forum.com/t/generating-wsdl-in-ruby/65834>\
**Category:** Ruby\
**Created:** [August 21, 2006, 7:12pm UTC](https://www.ruby-forum.com/t/generating-wsdl-in-ruby/65834 "2006-08-21T19:12:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 21, 2006, 7:12pm UTC](https://www.ruby-forum.com/t/generating-wsdl-in-ruby/65834/1 "2006-08-21T19:12:02Z")

</div>

does anybody know how to generate wsdl file when you create a soap  
server/client in ruby? is there a funcion?

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 22, 2006, 6:49am UTC](https://www.ruby-forum.com/t/generating-wsdl-in-ruby/65834/2 "2006-08-22T06:49:11Z")

</div>

depot\> ruby script/generate web\_service Backend find\_all\_products  
find\_product\_by\_id

This generates a stub API definition.

class BackendApi \< ActionWebService::API::Base  
api\_method :find\_all\_products  
api\_method :find\_product\_by\_id  
end

And it generates a skeleton controller.

class BackendController \< ApplicationController

wsdl\_service\_name ‘Backend’

def find\_all\_products  
end  
def find\_product\_by\_id  
end  
end  
And it generates a sample functional test.

We’ll need to finish off the API definition.

class BackendApi \< ActionWebService::API::Base  
api\_method :find\_all\_products,  
:returns =\> [[:int]]  
api\_method :find\_product\_by\_id,  
:expects =\> [:int],  
:returns =\> [Product]  
end

wsdl\_service\_name ‘Backend’

The wsdl\_service\_name( ) method  
associates a name with the service that will be used in generated Web  
Services Definition Language (WSDL). It is not necessary, but setting it  
is  
recommended.

i have picked the example from agile web development hope it helps
