# SOAP::RPC::StandaloneServer failed in the thread

**URL:** <https://www.ruby-forum.com/t/soap-standaloneserver-failed-in-the-thread/127765>\
**Category:** Ruby\
**Created:** [February 1, 2008, 3:35am UTC](https://www.ruby-forum.com/t/soap-standaloneserver-failed-in-the-thread/127765 "2008-02-01T03:35:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/dfb087/32.png) [@cyl](https://www.ruby-forum.com/u/cyl)\
**Post date:** [February 1, 2008, 3:35am UTC](https://www.ruby-forum.com/t/soap-standaloneserver-failed-in-the-thread/127765/1 "2008-02-01T03:35:51Z")

</div>

I wrote a simple soap server as below

NS = ‘[http://Test.com/Test](http://Test.com/Test)’;  
class Server \< SOAP::RPC::StandaloneServer  
def on\_init  
t = TestClass.new  
add\_method(t, ‘echo’)  
end  
end  
svr = Server.new(‘TEST’,NS,‘0.0.0.0’,12321)  
trap(‘INT’) {svr.shutdown}  
svr.start

it can run without problem. However if I run the same piece of code in  
a thread, it will not work

Thread.new do

#same code here

end  
#wait for the thread

I think the server does not start because the listening port I  
specified is not occupied by any application. Does anyone know what  
the problem is?
