Class: WSDL::SOAP::StandaloneServerStubCreator

Inherits:
Object
  • Object
show all
Includes:
ClassDefCreatorSupport
Defined in:
lib/wsdl/soap/standaloneServerStubCreator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ClassDefCreatorSupport

#assign_const, #basetype_mapped_class, #create_type_name, #dq, #dqname, #dump_method_signature, #mapped_class_basename, #mapped_class_name, #ndq, #nsym, #sym

Methods included from XSD::CodeGen::GenSupport

capitalize, constant?, #format, keyword?, safeconstname, safeconstname?, safemethodname, safemethodname?, safevarname, safevarname?, uncapitalize

Constructor Details

#initialize(definitions, name_creator, modulepath = nil) ⇒ StandaloneServerStubCreator

Returns a new instance of StandaloneServerStubCreator



24
25
26
27
28
# File 'lib/wsdl/soap/standaloneServerStubCreator.rb', line 24

def initialize(definitions, name_creator, modulepath = nil)
  @definitions = definitions
  @name_creator = name_creator
  @modulepath = modulepath
end

Instance Attribute Details

#definitionsObject (readonly)

Returns the value of attribute definitions



22
23
24
# File 'lib/wsdl/soap/standaloneServerStubCreator.rb', line 22

def definitions
  @definitions
end

Instance Method Details

#dump(service_name) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/wsdl/soap/standaloneServerStubCreator.rb', line 30

def dump(service_name)
  warn("- Standalone stub can have only 1 port for now.  So creating stub for the first port and rests are ignored.")
  warn("- Standalone server stub ignores port location defined in WSDL.  Location is http://localhost:10080/ by default.  Generated client from WSDL must be configured to point this endpoint manually.")
  services = @definitions.service(service_name)
  unless services
    raise RuntimeError.new("service not defined: #{service_name}")
  end
  ports = services.ports
  if ports.empty?
    raise RuntimeError.new("ports not found for #{service_name}")
  end
  port = ports[0]
  if port.porttype.nil?
    raise RuntimeError.new("porttype not found for #{port}")
  end
  dump_porttype(port.porttype)
end