Module: Handsoap

Defined in:
lib/handsoap/service.rb,
lib/handsoap/parser.rb,
lib/handsoap/service.rb,
lib/handsoap/compiler.rb,
lib/handsoap/xml_mason.rb,
lib/handsoap/xml_query_front.rb

Overview

Legacy/CS code here. This shouldn’t be used in new applications.

Defined Under Namespace

Modules: Parser, XmlMason, XmlQueryFront Classes: CodeWriter, Compiler, Fault, Response, Service

Constant Summary collapse

SOAP_NAMESPACE =
{ 1 => 'http://schemas.xmlsoap.org/soap/envelope/', 2 => 'http://www.w3.org/2001/12/soap-encoding' }

Class Method Summary collapse

Class Method Details

.http_driverObject



8
9
10
# File 'lib/handsoap/service.rb', line 8

def self.http_driver
  @http_driver || (self.http_driver = :curb)
end

.http_driver=(driver) ⇒ Object



12
13
14
15
16
17
# File 'lib/handsoap/service.rb', line 12

def self.http_driver=(driver)
  @http_driver = driver
  require 'httpclient' if driver == :httpclient
  require 'curb' if driver == :curb
  return driver
end

.pretty_format_envelope(xml_string) ⇒ Object



263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/handsoap/service.rb', line 263

def self.pretty_format_envelope(xml_string)
  if /^<.*:Envelope/.match(xml_string)
    begin
      doc = Handsoap::XmlQueryFront.parse_string(xml_string, Handsoap.xml_query_driver)
    rescue Exception => ex
      return "Formatting failed: " + ex.to_s
    end
    return doc.to_xml
    # return "\n\e[1;33m" + doc.to_s + "\e[0m"
  end
  return xml_string
end

.xml_query_driverObject



19
20
21
# File 'lib/handsoap/service.rb', line 19

def self.xml_query_driver
  @xml_query_driver || (self.xml_query_driver = :nokogiri)
end

.xml_query_driver=(driver) ⇒ Object



23
24
25
# File 'lib/handsoap/service.rb', line 23

def self.xml_query_driver=(driver)
  @xml_query_driver = Handsoap::XmlQueryFront.load_driver!(driver)
end