cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mailinglist@fhdw-campus.de" <mailingl...@fhdw-campus.de>
Subject Re: ws exception handling with an org.apache.cxf.service.invoker.Invoker
Date Tue, 11 Jan 2011 12:31:54 GMT
Thx it works :)

Am 10.01.2011 22:36, schrieb Daniel Kulp:
> On Monday 10 January 2011 4:28:53 pm mailinglist@fhdw-campus.de wrote:
>> Is there an information I should add to my question?
>
> I thought Freeman already answered this....
>
> Basically, don't set it in the return.   Just rethow the exception.  If it's
> not a runtime exception, do "throw new Fault(ex)" to throw our fault.  That's
> pretty much it.
>
> You can/should also do:
> exchange.getInMessage().put(FaultMode.class,
>                                              FaultMode.CHECKED_APPLICATION_FAULT);
> or:
> exchange.getInMessage().put(FaultMode.class,
>               FaultMode.UNCHECKED_APPLICATION_FAULT);
>
> if you know if the exception/fault is a checked or unchecked exception.   That
> allows the logging and such to be a bit smarter, but it is optional.
>
> Dan
>
>
>>
>> Am 06.01.2011 17:57, schrieb mailinglist@fhdw-campus.de:
>>> I am currently implementing my own Invoker, which calls a
>>> serviceImplementation. The services wsdl defines a fault:
>>>
>>> <wsdl:fault name="MyException">
>>> <soap:fault name="MyException" use="literal"/>
>>> </wsdl:fault>
>>>
>>> When this exception is thrown by the serviceImplementation and I set it
>>> as the return value of the invoker:
>>>
>>> public Object invoke(Exchange ex, Object o) {
>>> [...]
>>> MessageContentsList messageContentsList = (MessageContentsList) o;
>>> messageContentsList.add(returnValue);
>>> return messageContentsList;
>>> }
>>>
>>> I get: java.lang.IllegalArgumentException: argument type mismatch.
>>>
>>> So my question is: How can I make the invoker pass the "myException" to
>>> the webservice caller without getting an illegal argument exception?
>>>
>>> Thx in advance :)
>


Mime
View raw message