Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #350 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

offer clearly defined message interceptor API (chain)

Reported by: nahi Assigned to: nahi
Priority: normal Milestone: 1.5.6
Component: soap4r Version: 1.5
Keywords: Cc:

Description

from soap4r-ml

>> > > Ideally, soap4r will offer clearly defined message interceptor API (chain),
>> > > that allows attaching processors of outgoing and incoming messages, instead
>> > > of modifying the core soap4r classes (they way wss4r does it now).
> >
> > Interceptor.  Yes.  It should be allowed though I don't have any idea
> > about how the API should be for now.

Something like this was my thinking ....

client = SOAP::WSDLDriverFactory....

# assign outgoing interceptors
client.before << proc { |request| logger.debug(request.xml)}

client.before << proc { |request|
  # sign the request document;
  request.xml = sign(request.xml)
}

# assign incoming interceptors
client.after << proc { |response| logger.debug(response.xml)}
client.after << proc { |response| verify(response.xml) }

# invoke operation will 'call' outgoing interceptors, and when the response
is received  the incoming interceptor chain is executed.
client.call_method

The block argument are the request / response context
including the raw xml. The blocks can update the raw message.

Change History

06/02/07 10:39:40 changed by nahi

  • status changed from new to closed.
  • resolution set to fixed.

(In [1825]) * filter support.

you can add filters to intercept before SOAP marshalling and SOAP unmarshalling. filters are invoked in sequence. see filter sample at test/soap/filter/test_filter.rb closes #350.