Class: SOAP::RPC::Proxy

Inherits:
Object
  • Object
show all
Includes:
SOAP
Defined in:
lib/jasper_server/protocols/soap_monkeypatch.rb

Instance Method Summary collapse

Instance Method Details

#call(name, *params) ⇒ Object

Raises:

  • (EmptyResponseError)


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/jasper_server/protocols/soap_monkeypatch.rb', line 12

def call(name, *params)
  unless op_info = @operation[name]
    raise MethodDefinitionError, "method: #{name} not defined"
  end
  mapping_opt = create_mapping_opt
  req_header = create_request_header
  req_body = SOAPBody.new(
    op_info.request_body(params, @mapping_registry,
      @literal_mapping_registry, mapping_opt)
  )
  reqopt = create_encoding_opt(
    :soapaction => op_info.soapaction || @soapaction,
    :envelopenamespace => @options["soap.envelope.requestnamespace"],
    :default_encodingstyle =>
      @default_encodingstyle || op_info.request_default_encodingstyle,
    :elementformdefault => op_info.elementformdefault,
    :attributeformdefault => op_info.attributeformdefault
  )
  resopt = create_encoding_opt(
    :envelopenamespace => @options["soap.envelope.responsenamespace"],
    :default_encodingstyle =>
      @default_encodingstyle || op_info.response_default_encodingstyle,
    :elementformdefault => op_info.elementformdefault,
    :attributeformdefault => op_info.attributeformdefault
  )
  env = route(req_header, req_body, reqopt, resopt)
  raise EmptyResponseError unless env
  receive_headers(env.header)
  begin
    check_fault(env.body)
  rescue ::SOAP::FaultError => e
    op_info.raise_fault(e, @mapping_registry, @literal_mapping_registry)
  end
  response_obj = op_info.response_obj(env.body, @mapping_registry,
    @literal_mapping_registry, mapping_opt)
  response_obj.instance_variable_set(:@env, env)
  return response_obj
end