camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Talbut <jtal...@spudsoft.co.uk>
Subject Re: Modifying SOAP:Fault errors raised by endpoints
Date Tue, 09 Mar 2010 18:19:40 GMT
Thanks Willem.

Whilst that change will solve my particular problem, wouldn't it be 
better to have a more generic way to specify how the message should be 
formatted?
Something like the equivalent of the formatter that can be passed in for 
the log messages?
I'm happy to have a look at doing a patch to enable this.

Jim

On 09/03/2010 01:32, Willem Jiang wrote:
> Hi Jim,
>
> It should be easy to implement your requirement by adding a type 
> converter which can help use turn the List<Element> into a String.
> I filled a JIRA[1] for it.
>
> [1]https://issues.apache.org/activemq/browse/CAMEL-2531
>
> Willem
>
> Jim Talbut wrote:
>> Thank Willem,
>>
>> The first problem I've found with using PAYLOAD is that the Tracer 
>> (which I was using with JPA) is no longer logging the full message 
>> contents.
>> This is because it calls toString on the inbound message, but that is 
>> now a CxfPayload, which contains a List<Element> and 
>> Element.toString() does not walk the DOM.
>> Is the best approach for resolving this to simply replicate the 
>> functionality of Tracer in my own classes?
>>
>> Jim
>>
>> On 08/03/2010 02:53, Willem Jiang wrote:
>>> Hi Jim,
>>>
>>> In MESSAGE DataFormat, camel-cxf endpoint will not read the Message 
>>> detail information, it just redirect the input stream.
>>> PAYLOAD and POJO DataFormat will give you the exception that you want.
>>>
>>> Willem
>>>
>>> Jim Talbut wrote:
>>>>
>>>>
>>>> On 07/03/2010 20:08, Jim Talbut wrote:
>>>>> exchange.getIn().On 07/03/2010 07:05, Claus Ibsen wrote:
>>>>>> Hi
>>>>>>
>>>>>> You can enable the soapFault=true on the CamelContext which turns
>>>>>> faults into exceptions.
>>>>>>
>>>>>> Or you can simply add a processor step at the end of your route,
and
>>>>>> check if the exchange is a fault
>>>>>>
>>>>>> public void process(Exchange exchange) {
>>>>>> boolean isFault = exchange.hasOut()&&  exchange.getOut().isFault();
>>>>>> // do something before the OUT message is returned to the caller
>>>>>> }
>>>>> Putting on the extra process step works (I didn't know you could 
>>>>> do that, I'd assumed that InOut routes were stack-like, but I 
>>>>> guess they're actually more like a loop given that they end up 
>>>>> back at the source from).
>>>>>
>>>>> But neither context.setHandleFault(true) nor 
>>>>> from("xxx").handleFault().to("yyy") work - my onException is never 
>>>>> called and the soap:fault is returned to the client.
>>>>> I think the problem is that the CXF transport isn't setting it as 
>>>>> a fault.
>>>> Ah!
>>>> My apologies for requiring you to engage psychic debugging (the 
>>>> problem with being new to something is that you don't know what is 
>>>> important).
>>>>
>>>> The problem was that I was working in with DataFormat.MESSAGE - and 
>>>> I presume that means I'm taking on more responsibility than I want to.
>>>> A change to PAYLOAD should be adequate for my needs and now I get 
>>>> an exception.
>>>>
>>>> Might be worth a note on the Camel CXF page to explain that 
>>>> difference.
>>>>
>>>> Thanks very much for your help.
>>>>
>>>> Jim
>>>>
>>>
>>
>>
>


Mime
View raw message