camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Johnson <brad.john...@mediadriver.com>
Subject Re: Authentication Header Missing from CXF Endpoint
Date Mon, 24 Oct 2016 20:32:07 GMT
In addition to trying the requestBodyHeader (or whatever the request name
is) have you tried looking the results of the Exchange you get back by
calling getException?

On Mon, Oct 24, 2016 at 3:25 PM, Brad Johnson <brad.johnson@mediadriver.com>
wrote:

> Are you  sending a Processor across?  I've really no idea if that would
> work or not.  It's an object so I suppose if you cast the object on the
> other side you'd end up with the Processor back(?)
>
>
> Have you tried on of the methods like producerTemplate.request(endpointURI,body,
> Map<String,String>) where the map contains the headers?
>
> On Mon, Oct 24, 2016 at 9:45 AM, aravind r <aravindrajasekharan@gmail.com>
> wrote:
>
>> Hi All,
>>
>> Any help is appreciated as i am trying to solve this for 2 days now.
>>
>> Trying to unit test a CXF end point secured with Spring Authentication. I
>> tried passing in as below the Authentication header however when it
>> reaches
>> my CXF Endpoint and down to route. The header is missing.
>>
>> I tried a lot of combinations and i did read some where that it doesn't
>> pass it via CXF endpoint. Is this a bug?, that was a post from 2012
>> though.
>> any workarounds?.
>>
>> How should i test my whole integration flow?.
>>
>>
>> Exchange responseExchange = producerTemplate.request("cxfrs://
>> http://localhost:9001/", new Processor() {
>>
>>
>>     @Override
>>     public void process(Exchange exchange) throws Exception {
>>
>>
>>         exchange.setPattern(ExchangePattern.InOut);
>>         Message inMessage = exchange.getIn();
>>         inMessage.setHeader("CamelCxfRsUsingHttpAPI", Boolean.TRUE);
>>         inMessage.setHeader("CamelHttpMethod", "POST");
>>         inMessage.setHeader("operationName", "getAccounts");
>>         inMessage.setHeader(Exchange.CONTENT_TYPE,"application/json");
>>         inMessage.setHeader("CamelAuthentication",subject);
>>         inMessage.setHeader("CamelHttpPath", "/v1/core/getAccounts");
>>         inMessage.setBody( new ObjectMapper().writeValueAsString(bo));
>>
>>
>> *exchange.getIn().setHeader(Exchange.AUTHENTICATION,subject);*
>>     }
>> });
>>
>> Regards,
>> Aravind
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message