R
Rickard Sjostrom
Hi!
1. I have built a small SOAP server and wonders and have a few
questions. I included the code below if it is of interest!
1. What is the best trick to get these requests spawned into new
threads/processes so that the server will always be available? (if
running as standalone server)
2. Is the trick to have it to run in the web server?
3. Is the web server thing accomplished by letting the script run as a
CGI script?
This how I have done my SOAP server test:
------------
require 'server_dispatcher'
require 'soap/rpc/standaloneServer'
class DeliveryService < SOAP::RPC::StandaloneServer
#will be run when an instance of this class is created
def on_init
obj = MyClass.new
add_method(obj, "find", "array")
end
end
class MyClass
def find(array)
return array.push("extra")
end
end
-------------------
main prog:
-------------------
require 'delivery_service'
server = DeliveryService.new("Test",
"http://rickthemick.com/DeliveryService", "0.0.0.0", 9090)
trap('INT') {
server.shutdown
}
puts "Service started..."
server.start
1. I have built a small SOAP server and wonders and have a few
questions. I included the code below if it is of interest!
1. What is the best trick to get these requests spawned into new
threads/processes so that the server will always be available? (if
running as standalone server)
2. Is the trick to have it to run in the web server?
3. Is the web server thing accomplished by letting the script run as a
CGI script?
This how I have done my SOAP server test:
------------
require 'server_dispatcher'
require 'soap/rpc/standaloneServer'
class DeliveryService < SOAP::RPC::StandaloneServer
#will be run when an instance of this class is created
def on_init
obj = MyClass.new
add_method(obj, "find", "array")
end
end
class MyClass
def find(array)
return array.push("extra")
end
end
-------------------
main prog:
-------------------
require 'delivery_service'
server = DeliveryService.new("Test",
"http://rickthemick.com/DeliveryService", "0.0.0.0", 9090)
trap('INT') {
server.shutdown
}
puts "Service started..."
server.start