File: httpd.rb

package info (click to toggle)
soap4r 1.4.8-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,472 kB
  • ctags: 2,206
  • sloc: ruby: 19,295; makefile: 58; sh: 41; perl: 10
file content (34 lines) | stat: -rwxr-xr-x 909 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/local/bin/ruby

require './webrick'

require 'devel/logger'
logDev = Devel::Logger.new( 'httpd.log' )

wwwsvr = WEBrick::HTTPServer.new(
  :BindAddress    => "0.0.0.0",
  :Port           => 10080, 
  :Logger         => logDev
)

require 'soaplet'
soapsrv = WEBrick::SOAPlet.new

require 'exchange'
#soapsrv.addRequestServant( ExchangeServiceNamespace, Exchange )
soapsrv.addServant( ExchangeServiceNamespace, Exchange.new )

require 'sampleStruct'
soapsrv.addServant( SampleStructServiceNamespace, SampleStructService.new )

$:.push( '../../test/sm11' )
require 'servant'
servant = Sm11PortType.new
Sm11PortType::Methods.each do | nameAs, name, params, soapAction, ns |
  soapsrv.appScopeRouter.addMethodAs( ns, servant, name, nameAs, params )
end
soapsrv.appScopeRouter.mappingRegistry = Sm11PortType::MappingRegistry
wwwsvr.mount( '/soapsrv', soapsrv )

trap( "INT" ){ wwwsvr.shutdown }
wwwsvr.start