summaryrefslogtreecommitdiff
path: root/sample/soap/sampleStruct
diff options
context:
space:
mode:
Diffstat (limited to 'sample/soap/sampleStruct')
-rw-r--r--sample/soap/sampleStruct/httpd.rb13
-rw-r--r--sample/soap/sampleStruct/samplehttpd.conf2
2 files changed, 11 insertions, 4 deletions
diff --git a/sample/soap/sampleStruct/httpd.rb b/sample/soap/sampleStruct/httpd.rb
index ee8ab09f50..bebcff96c6 100644
--- a/sample/soap/sampleStruct/httpd.rb
+++ b/sample/soap/sampleStruct/httpd.rb
@@ -1,14 +1,19 @@
#!/usr/bin/env ruby
require 'webrick'
-require 'getopts'
+require 'soap/property'
-getopts "", 'r:', 'p:8808'
+docroot = "."
+port = 8808
+if opt = SOAP::Property.loadproperty("samplehttpd.conf")
+ docroot = opt["docroot"]
+ port = Integer(opt["port"])
+end
s = WEBrick::HTTPServer.new(
:BindAddress => "0.0.0.0",
- :Port => $OPT_p.to_i,
- :DocumentRoot => $OPT_r || ".",
+ :Port => port,
+ :DocumentRoot => docroot,
:CGIPathEnv => ENV['PATH']
)
trap(:INT){ s.shutdown }
diff --git a/sample/soap/sampleStruct/samplehttpd.conf b/sample/soap/sampleStruct/samplehttpd.conf
new file mode 100644
index 0000000000..85e9995021
--- /dev/null
+++ b/sample/soap/sampleStruct/samplehttpd.conf
@@ -0,0 +1,2 @@
+docroot = .
+port = 8808