In general, CXF routes requests based on the target URI/address, not the 
Action, although there are some exceptions to that….

In general, CXF only allows a single endpoint to be deployed on a specific 
address.   Through the MultipleEndpointObserver stuff, it’s possible to do it, 
but it’s not exactly easy.  

So… where is the Action used?   Under normal circumstances, the Action will be 
looked at by various interceptors on the chain that may be looking for a 
specific Action.   For example, if WS-RM is configured, the RM interceptors 
will be looking for Actions that pertain to RM (CreateSequence, etc…) at which 
point they will re-route the request into the RM stuff.   WS-SecureConversation 
is another example.  It’s interceptor will look for Actions related to 
issue/renew/cancel tokens.   WS-Mex is another.      Basically, if it gets 
through the chain without something “intercepting” the request, the request 
just goes to the normal endpoint like a normal request and is handled via the 
contents of the soap body.     We likely SHOULD have a check in there to make 
sure the Action matches like we do check to make sure the SOAPAction header (if 
specified) matches.

That said, writing this has kind of gotten me thinking…..   Those three uses 
cases likely could be re-written in terms of the MulipleEndpointObserver stuff 
with an Observer that would route based on the Actions.    Each of those three 
would just need to register an Endpoint with the Action based observer and it 
would handle the routing.     That’s a lot of code to refactor though…  Hmmm…..

Dan



On Jul 9, 2014, at 10:14 AM, Richard Snowden <[email protected]> 
wrote:

> Hi,
> 
> I'm working with the WS-Addressing example from CXF 3.0.0 found here:
> apache-cxf-3.0.0-src\distribution\src\main\release\samples\ws_addressing\
> 
> I captured one request, sent from client to server, and used Chromes
> Postman extension to modify it:
> - made sure there's no SOAPAction the HTTP-Header
> - set wsa:Action to some random value, like "blablabla"
> 
> Surprisingly it still worked!
> 
> It seems the WS-Addressing SOAP-Header field "Action" is not used at all in
> CXF. Is this a bug or a feature? ;-)
> 
> 
> Here is one of my requests:
> 
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>    <soap:Header>
>        <Action xmlns="http://www.w3.org/2005/08/addressing
> ">blablabla</Action>
>        <MessageID xmlns="http://www.w3.org/2005/08/addressing
> ">urn:uuid:fa46e01c-f5c7-4d5b-b653-0f79d59885e8</MessageID>
>        <To xmlns="http://www.w3.org/2005/08/addressing";>
> http://localhost:9000/SoapContext/SoapPort</To>
>        <ReplyTo xmlns="http://www.w3.org/2005/08/addressing";>
>            <Address>http://www.w3.org/2005/08/addressing/anonymous
> </Address>
>        </ReplyTo>
>    </soap:Header>
>    <soap:Body>
>        <greetMe xmlns="http://apache.org/hello_world_soap_http/types";>
>            <requestType>rsnowden</requestType>
>        </greetMe>
>    </soap:Body>
> </soap:Envelope>

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to