Sha256: da47a376454811f2f49024c5bd1b789dcfafa9f2cd0c867d104f0ff6c998a7e7

Contents?: true

Size: 948 Bytes

Versions: 1

Compression:

Stored size: 948 Bytes

Contents

require "ox"
require "transformator/transformation/step"
require_relative "../request_transformation"

class Skala::PrimoAdapter::Search::RequestTransformation::
  SetupTarget < Transformator::Transformation::Step

  def call
    # create empty ox document
    self.target = Ox::Document.new(version: "1.0", encoding: "UTF-8")

    # populate target with soap request skeleton
    self.target << Ox.parse(
      <<-xml
        <env:Envelope
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:impl="http://primo.kobv.de/PrimoWebServices/services/searcher"
            xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:ins0="http://xml.apache.org/xml-soap">
          <env:Body>
            <impl:searchBrief><searchRequestStr></searchRequestStr></impl:searchBrief>
          </env:Body>
        </env:Envelope>
      xml
    )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skala-1.1.0 lib/skala/primo_adapter/search/request_transformation/setup_target.rb