module SterlingApi::XmlHelper

Public Instance Methods

soap_wrapper(xml) click to toggle source
# File lib/sterling_api/xml_helper.rb, line 6
    def soap_wrapper(xml)
      %Q{<?xml version="1.0"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
  #{strip_instruct(xml)}
  </soapenv:Body>
</soapenv:Envelope>
      }
    end
strip_instruct(xml) click to toggle source
# File lib/sterling_api/xml_helper.rb, line 36
def strip_instruct(xml)
  xml.gsub!(%r{<\?xml\s+version=['"]1.0['"]\s*\?>}, '')
  xml
end
xml_rpc_wrapper(xml) click to toggle source
# File lib/sterling_api/xml_helper.rb, line 19
    def xml_rpc_wrapper(xml)
      %Q{<?xml version="1.0"?>
<methodCall>
  <methodName>webhuckXMLrequest</methodName>
    <params>
      <param>
        <value>
          <struct>
            #{strip_instruct(xml)}
          </struct>
        </value>
      </param>
    </params>
</methodCall>
      }
    end