# Soap4r

**URL:** <https://www.ruby-forum.com/t/soap4r/142195>\
**Category:** Rails\
**Created:** [July 4, 2008, 12:47pm UTC](https://www.ruby-forum.com/t/soap4r/142195 "2008-07-04T12:47:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sukeerthiadiga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@sukeerthiadiga](https://www.ruby-forum.com/u/sukeerthiadiga)\
**Post date:** [July 4, 2008, 12:47pm UTC](https://www.ruby-forum.com/t/soap4r/142195/1 "2008-07-04T12:47:01Z")

</div>

can anyone give me a simple code how to use soap4r with a mongrel  
server. a client and server code.  
I wanna use this concept in my application. this is new to me…

i have used this with webrick and its working fine.  
i wan to go for mongrel.  
sample code of my application is this

server:

require ‘soap/rpc/standaloneServer’

class SymptomCheckerServer \< SOAP::RPC::StandaloneServer

def on\_init  
@log.level = Logger::Severity::DEBUG  
suggest\_diagnoses= SuggestDiagnosesController.new  
add\_method(suggest\_diagnoses, ‘main\_diagnoses’, ‘params’)  
end  
end

server = SymptomCheckerServer.new(‘hws’, ‘urn:hws’, ‘192.168.1.52’,  
6565)  
trap(:INT) do  
server.shutdown  
end  
server.start

client code:

```
   s = SOAP::RPC::Driver.new('http://192.168.1.52:6565/',

```

‘urn:hws’) #make connection with server  
s.add\_method(“main\_diagnoses”,“institution\_id”) #adding method  
@all\_system\_ids= s.main\_diagnoses(institution\_id)

thanks in advance
