Changeset 1671
- Timestamp:
- 11/15/05 22:38:38 (3 years ago)
- Files:
-
- trunk/lib/soap/rpc/httpserver.rb (modified) (2 diffs)
- trunk/sample/wsdl/helloworld/changesTohttpserver (deleted)
- trunk/sample/wsdl/helloworld/server/hw_s.rb (modified) (2 diffs)
- trunk/sample/wsdl/helloworld/server/hws.wsdl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/soap/rpc/httpserver.rb
r1670 r1671 1 1 # SOAP4R - WEBrick HTTP Server 2 # Copyright (C) 2003, 2004 by NAKAMURA, Hiroshi <nahi@ruby-lang.org>.2 # Copyright (C) 2003, 2004, 2005 by NAKAMURA, Hiroshi <nahi@ruby-lang.org>. 3 3 4 4 # This program is copyrighted free software by NAKAMURA, Hiroshi. You can … … 33 33 on_init 34 34 @server = WEBrick::HTTPServer.new(@webrick_config) 35 @server.mount('/soaprouter', @soaplet) 36 if wsdldir = config[:WSDLDocumentDirectory] 37 @server.mount('/wsdl', WEBrick::HTTPServlet::FileHandler, wsdldir) 38 end 39 # for backward compatibility 35 40 @server.mount('/', @soaplet) 36 41 end trunk/sample/wsdl/helloworld/server/hw_s.rb
r1640 r1671 1 require 'soap/rpc/ standaloneServer'2 class QueryServer < SOAP::RPC:: StandaloneServer1 require 'soap/rpc/httpserver' 2 class QueryServer < SOAP::RPC::HTTPServer 3 3 def on_init 4 4 #@log.level = Logger::Severity::DEBUG … … 7 7 8 8 def hello_world(from) 9 sOut="Hellow world from #{from}"10 sOut9 sOut="Hellow world from #{from}" 10 sOut 11 11 end 12 12 end 13 13 14 14 if $0 == __FILE__ 15 # You need to use ../changesTohttpserver/*.rb to supply WSDL files in the 16 # specified directory. It may be merged in the future (with some changes) 17 # server = QueryServer.new('hws', 'http://localhost:2000/wsdl/hws.wsdl', '0.0.0.0', 2000, "c:/soap4r-20050420/sample/soap/helloworld") 18 19 server = QueryServer.new('hws', 'http://localhost:2000/wsdl/hws.wsdl', '0.0.0.0', 2000) 15 server = QueryServer.new( 16 :BindAddress => '0.0.0.0', 17 :Port => 2000, 18 :SOAPDefaultNamespace => 'http://localhost:2000/wsdl/hws.wsdl', 19 :WSDLDocumentDirectory => '.' 20 ) 20 21 trap(:INT) do 21 22 server.shutdown trunk/sample/wsdl/helloworld/server/hws.wsdl
r1640 r1671 10 10 xmlns="http://schemas.xmlsoap.org/wsdl/" 11 11 targetNamespace="http://localhost:2000/wsdl/hws.wsdl"> 12 <message name="getInvoices"> 13 <part name="from" type="xsd:date"/> 14 <part name="to" type="xsd:date"/> 12 <message name="getTermRequest"> 13 <part name="from" type="xsd:string"/> 15 14 </message> 16 15 17 <message name=" getInvoiceResponse">18 <part name=" queryInvoiceResponse" type="xsd:string"/>16 <message name="hello_worldResponse"> 17 <part name="from" type="xsd:string"/> 19 18 </message> 20 19 21 <portType name=" queryPort">22 <operation name=" queryInvoice">23 <input message="get Invoices"/>24 <output message=" getInvoiceResponse"/>20 <portType name="hwsPort"> 21 <operation name="hello_world"> 22 <input message="getTermRequest"/> 23 <output message="hello_worldResponse"/> 25 24 </operation> 26 25 </portType> 27 <binding name=" queryBinding" type="tns:queryPort">26 <binding name="hwsBinding" type="tns:hwsPort"> 28 27 <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> 29 <operation name=" queryInvoice">30 <soap:operation soap action="http://localhost:2000/wsdl/hws.wsdl#queryInvoice" style="rpc"/>28 <operation name="hello_world"> 29 <soap:operation soapAction="http://localhost:2000/wsdl/hws.wsdl#hello_world" style="rpc"/> 31 30 <input> 32 31 <soap:body use="encoded" namespace="http://localhost:2000/wsdl/hws.wsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> … … 38 37 </binding> 39 38 <service name="hws"> 40 <documentation>The service returns subscriptions paid by invoice in the period from(date)41 to to(date)</documentation>42 <port name=" queryPort" binding="tns:queryBinding">39 <documentation>The service simply says hello world from something supplied</documentation> 40 41 <port name="hwsPort" binding="tns:hwsBinding"> 43 42 <soap:address location="http://localhost:2000/"/> 44 43 </port> 45 44 </service> 45 46 46 </definitions>