cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Interceptor chains, one way requests, WSA FaultTo
Date Thu, 30 Sep 2010 18:45:39 GMT

My question is:  is this even a valid use case?

According to the WS-I Basic Profile:


R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response that 
contains an envelope. Specifically, the HTTP response entity-body must be 
empty.

R2750 A CONSUMER MUST ignore an envelope carried in a HTTP response message in 
a one-way operation.

R2727 For one-way operations, a CONSUMER MUST NOT interpret a successful HTTP 
response status code (i.e., 2xx) to mean the message is valid or that the 
receiver would process it.

One-way operations do not produce SOAP responses. Therefore, the Profile 
prohibits sending a SOAP envelope in response to a one-way operation. 


Thus, producing a Fault as part of processing a One-Way operation would be 
against the spec.    


Dan




On Thursday 30 September 2010 1:32:11 pm Sergey Beryozkin wrote:
> Hi
> 
> I'm looking at the following issue.
> A oneway request with a decoupled WSA FaultTo address is processed on the
> server side and then a fault is thrown.
> MapCodec and MapAggregator interceptors are not handling this case at the
> moment.
> 
> Eoghan clarified how ContextUtils.rebaseAddress used by MapAggregator
> works. Particularly, a partial response is sent back asap, and then
> an out message is prepared such that a normal response is sent to the
> decoupled ReplyTo (during this process an out interceptor chain is
> created).
> 
> The question is how to forward a fault to the decoupled address in case of
> oneway requests and particularly, how to build a proper chain.
> I'm prototyping the following code in MapCodec.handleFault() :
> 
> // MapCodec::handleFault(Message message)
>             if (oneWay and !isRequestor())
>             {
>                Exchange exchange = message.getExchange();
> 
>                // we need the input message so that we can get the WSA
> properties from it
> 
>                Message inMessage = exchange.getInMessage();
>                AddressingPropertiesImpl maps =
>                    ContextUtils.retrieveMAPs(inMessage, false, false,
> true); if (maps != null &&
> !ContextUtils.isGenericAddress(maps.getFaultTo())) {
> 
>                 // boilerplate code for getting a backChannel, using
> inMessage
>                 Destination target = inMessage.getDestination();
>                 exchange.setOutMessage(message);
> 
>                 Conduit backChannel = target.getBackChannel(inMessage,
>                                                                 message,
> 
> maps.getFaultTo());
> 
>                 // Set up the chain
>                 InterceptorChain chain =
> OutgoingChainInterceptor.getOutInterceptorChain(exchange);
>                 message.setInterceptorChain(chain);
> 
>                 exchange.put(ConduitSelector.class,
>                                      new
> PreexistingConduitSelector(backChannel,
> 
> exchange.get(Endpoint.class)));
> 
>                 chain.doIntercept(message)
>            }
> 
> 
> The question is basically how to set up an out chain properly to deal with
> delivering a fault message in case of oneway requests.
> 
> Some clarifications would help
> thanks, Sergey

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message