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.



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

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.



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

def definitions
  @definitions
end

Instance Method Details

#dump(service_name) ⇒ Object



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

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