# File lib/wsdl/soap/cgiStubCreator.rb, line 30 30: def dump(service_name) 31: warn("CGI stub can have only 1 port. Creating stub for the first port... Rests are ignored.") 32: services = @definitions.service(service_name) 33: unless services 34: raise RuntimeError.new("service not defined: #{service_name}") 35: end 36: ports = services.ports 37: if ports.empty? 38: raise RuntimeError.new("ports not found for #{service_name}") 39: end 40: port = ports[0] 41: if port.porttype.nil? 42: raise RuntimeError.new("porttype not found for #{port}") 43: end 44: dump_porttype(port.porttype) 45: end
# File lib/wsdl/soap/cgiStubCreator.rb, line 49 49: def dump_porttype(porttype) 50: class_name = mapped_class_name(porttype.name, @modulepath) 51: defined_const = {} 52: result = MethodDefCreator.new(@definitions, @name_creator, @modulepath, defined_const).dump(porttype.name) 53: methoddef = result[:methoddef] 54: wsdl_name = @definitions.name ? @definitions.name.name : 'default' 55: mrname = safeconstname(wsdl_name + 'MappingRegistry') 56: c1 = XSD::CodeGen::ClassDef.new(class_name) 57: c1.def_require("soap/rpc/cgistub") 58: c1.def_code Methods = [#{methoddef.gsub(/^/, " ")}] 59: defined_const.each do |ns, tag| 60: c1.def_const(tag, dq(ns)) 61: end 62: c2 = XSD::CodeGen::ClassDef.new(class_name + "App", 63: "::SOAP::RPC::CGIStub") 64: c2.def_method("initialize", "*arg") do 65: super(*arg) servant = #{class_name}.new #{class_name}::Methods.each do |definitions| opt = definitions.last if opt[:request_style] == :document @router.add_document_operation(servant, *definitions) else @router.add_rpc_operation(servant, *definitions) end end self.mapping_registry = #{mrname}::EncodedRegistry self.literal_mapping_registry = #{mrname}::LiteralRegistry self.level = Logger::Severity::ERROR 66: end 67: c1.dump + "\n" + c2.dump + format( #{class_name}App.new('app', nil).start) 68: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.