lib/adwords4r/soap4rpatches.rb in adwords4r-17.0.0 vs lib/adwords4r/soap4rpatches.rb in adwords4r-17.0.1
- old
+ new
@@ -93,26 +93,10 @@
# within driver (@proxy).
__attr_proxy :callbackhandler, true
end
- class SubDriver < Driver
-
- def invoke(headers, body)
- if headers and !headers.is_a?(SOAPHeader)
- headers = create_header(headers)
- end
- set_wiredump_file_base(body.elename.name)
- env = @proxy.invoke(headers, body)
- if env.nil?
- return nil, nil
- else
- return env.header, env.body
- end
- end
- end
-
class Proxy
attr_accessor :callbackhandler
# This method is a copy of the one included in soap4r, with the additions
@@ -144,25 +128,24 @@
end
if resopt[:generate_explicit_type].nil?
resopt[:generate_explicit_type] = (op_info.response_use == :encoded)
end
env = route(req_header, req_body, reqopt, resopt)
+ ### Patch starts here ###
+ unless callbackhandler.nil?
+ callbackhandler.on_callback(name, @endpoint_url, env, params)
+ end
+ ### Patch ends here ###
if op_info.response_use.nil?
return nil
end
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
-
- ### Patch starts here ###
- if (!callbackhandler.nil?)
- callbackhandler.on_callback(name, @endpoint_url, env, params)
- end
- ### Patch ends here ###
if @return_response_as_xml
resopt[:response_as_xml]
else
op_info.response_obj(env.body, @mapping_registry,