Class: WSDL::Request::RPCWrapper Private

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl/request/rpc_wrapper.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Wraps request body nodes in an RPC operation element for RPC/literal style.

Per SOAP 1.1 §7.1 and WS-I Basic Profile §4.7.10, an RPC/literal request wraps its body parts in an element named after the operation, qualified with the namespace from soap:body/@namespace.

Instance Method Summary collapse

Constructor Details

#initialize(operation_name:, namespace_uri:) ⇒ RPCWrapper

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of RPCWrapper.

Parameters:

  • operation_name (String)

    the WSDL operation name

  • namespace_uri (String, nil)

    the soap:body namespace (may be nil)



15
16
17
18
# File 'lib/wsdl/request/rpc_wrapper.rb', line 15

def initialize(operation_name:, namespace_uri:)
  @operation_name = operation_name
  @namespace_uri = namespace_uri
end

Instance Method Details

#wrap(document) ⇒ Request::Envelope

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Wraps the document's body nodes in an RPC wrapper element.

Returns the document unchanged if wrapping is not needed (empty body or already wrapped).

Parameters:

Returns:



27
28
29
30
31
32
# File 'lib/wsdl/request/rpc_wrapper.rb', line 27

def wrap(document)
  return document if document.body.empty?
  return document if already_wrapped?(document.body)

  build_wrapped_document(document)
end