# Web service client

**URL:** <https://www.ruby-forum.com/t/web-service-client/122081>\
**Category:** Ruby\
**Created:** [December 4, 2007, 2:13pm UTC](https://www.ruby-forum.com/t/web-service-client/122081 "2007-12-04T14:13:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ochomo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/45deac/32.png) [@ochomo](https://www.ruby-forum.com/u/ochomo)\
**Post date:** [December 4, 2007, 2:13pm UTC](https://www.ruby-forum.com/t/web-service-client/122081/1 "2007-12-04T14:13:47Z")

</div>

Hello All,

I have a simple web-service that i quickly generated using netbeans java  
IDE.

I would like to consume the web service from a ruby program.

Is it possible?

How can I go about this?

ochomo z. o.

---

<div class="post-metadata">

**Author:** ![ochomo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/45deac/32.png) [@ochomo](https://www.ruby-forum.com/u/ochomo)\
**Post date:** [December 4, 2007, 8:59pm UTC](https://www.ruby-forum.com/t/web-service-client/122081/2 "2007-12-04T20:59:19Z")

</div>

> How can I go about this?
> 
> ochomo z. o.

This stuff should get you going with both a client and a server:  
[http://sitekreator.com/satishtalim/web\_services.html](http://sitekreator.com/satishtalim/web_services.html)

---

<div class="post-metadata">

**Author:** ![ochomo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/45deac/32.png) [@ochomo](https://www.ruby-forum.com/u/ochomo)\
**Post date:** [December 5, 2007, 6:58am UTC](https://www.ruby-forum.com/t/web-service-client/122081/3 "2007-12-05T06:58:43Z")

</div>

Thanks so much Siep

---

<div class="post-metadata">

**Author:** ![ochomo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/45deac/32.png) [@ochomo](https://www.ruby-forum.com/u/ochomo)\
**Post date:** [December 5, 2007, 12:38pm UTC](https://www.ruby-forum.com/t/web-service-client/122081/4 "2007-12-05T12:38:25Z")

</div>

I have done a small ruby app to consume a web service on SUN App Server.  
But I have an error when running the app.

here is the code:

require ‘soap/rpc/driver’

driver = SOAP::RPC::Driver.new(  
‘[http://localhost:8085/helloservice/HelloService](http://localhost:8085/helloservice/HelloService)’,  
‘urn:[http://endpoint.helloservice/](http://endpoint.helloservice/)’)

driver.add\_method(‘sayHello’)  
puts driver.sayHello

the error message i get:

: Cannot find the dispatch method (SOAP::FaultError)

can someone help in identifying the right parameters.

my WSDL

\<?xml version="1.0" encoding="UTF-8"?\>\<definitions 

xmlns=“[http://schemas.xmlsoap.org/wsdl/](http://schemas.xmlsoap.org/wsdl/)”  
xmlns:tns=“[http://endpoint.helloservice/](http://endpoint.helloservice/)”  
xmlns:xsd=“[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)”  
xmlns:soap=“[http://schemas.xmlsoap.org/wsdl/soap/](http://schemas.xmlsoap.org/wsdl/soap/)”  
targetNamespace=“[http://endpoint.helloservice/](http://endpoint.helloservice/)” name=“HelloService”\>  
  
xsd:schema  
\<xsd:import namespace=“[http://endpoint.helloservice/](http://endpoint.helloservice/)”  
schemaLocation=“[http://localhost:8085/helloservice/HelloService/\_\_container$publishing$subctx/WEB-INF/wsdl/HelloService\_schema1.xsd](http://localhost:8085/helloservice/HelloService/__container$publishing$subctx/WEB-INF/wsdl/HelloService_schema1.xsd)”  
xmlns:wsdl=“[http://schemas.xmlsoap.org/wsdl/](http://schemas.xmlsoap.org/wsdl/)”  
xmlns:soap12=“[http://schemas.xmlsoap.org/wsdl/soap12/](http://schemas.xmlsoap.org/wsdl/soap12/)”/\>  
\</xsd:schema\>  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
\<soap:binding transport=“[http://schemas.xmlsoap.org/soap/http](http://schemas.xmlsoap.org/soap/http)”  
style=“document”/\>  
  
\<soap:operation soapAction=“”/\>  
  
\<soap:body use=“literal”/\>  
  
  
\<soap:body use=“literal”/\>  
  
  
  
  
  
\<soap:address  
location=“[http://localhost:8085/helloservice/HelloService](http://localhost:8085/helloservice/HelloService)”  
xmlns:wsdl=“[http://schemas.xmlsoap.org/wsdl/](http://schemas.xmlsoap.org/wsdl/)”  
xmlns:soap12=“[http://schemas.xmlsoap.org/wsdl/soap12/](http://schemas.xmlsoap.org/wsdl/soap12/)”/\>
