Class: WsdlMapper::Runtime::S8rBase
- Inherits:
-
Object
- Object
- WsdlMapper::Runtime::S8rBase
- Defined in:
- lib/wsdl_mapper/runtime/s8r_base.rb
Instance Method Summary (collapse)
-
- (Object) build(x, envelope)
Serializes the
envelope
usingx
. - - (Object) build_body(x, body) abstract
- - (Object) build_header(x, header) abstract
-
- (S8rBase) initialize(type_directory, default_namespace = nil)
constructor
A new instance of S8rBase.
-
- (Nokogiri::XML::Document) to_doc(envelope)
Serializes the
envelope
and returns a Nokogiri::XML::Document. -
- (String) to_xml(envelope)
Serializes the
envelope
and returns an XML string.
Constructor Details
- (S8rBase) initialize(type_directory, default_namespace = nil)
Returns a new instance of S8rBase
9 10 11 12 |
# File 'lib/wsdl_mapper/runtime/s8r_base.rb', line 9 def initialize(type_directory, default_namespace = nil) @type_directory = type_directory @default_namespace = default_namespace end |
Instance Method Details
- (Object) build(x, envelope)
Serializes the envelope
using x
33 34 35 36 37 38 |
# File 'lib/wsdl_mapper/runtime/s8r_base.rb', line 33 def build(x, envelope) x.complex(nil, ['http://schemas.xmlsoap.org/soap/envelope/', 'Envelope'], []) do |x| build_header(x, envelope.header) build_body(x, envelope.body) end end |
- (Object) build_body(x, body)
This method is abstract.
50 51 52 |
# File 'lib/wsdl_mapper/runtime/s8r_base.rb', line 50 def build_body(x, body) raise NotImplementedError end |
- (Object) build_header(x, header)
This method is abstract.
43 44 45 |
# File 'lib/wsdl_mapper/runtime/s8r_base.rb', line 43 def build_header(x, header) raise NotImplementedError end |
- (Nokogiri::XML::Document) to_doc(envelope)
Serializes the envelope
and returns a Nokogiri::XML::Document
24 25 26 27 28 |
# File 'lib/wsdl_mapper/runtime/s8r_base.rb', line 24 def to_doc(envelope) core = WsdlMapper::Serializers::SerializerCore.new resolver: @type_directory, default_namespace: @default_namespace build core, envelope core.to_doc end |
- (String) to_xml(envelope)
Serializes the envelope
and returns an XML string
17 18 19 |
# File 'lib/wsdl_mapper/runtime/s8r_base.rb', line 17 def to_xml(envelope) to_doc(envelope).to_xml save_with: Nokogiri::XML::Node::SaveOptions::NO_DECLARATION end |