Thx it works :)

Am 10.01.2011 22:36, schrieb Daniel Kulp:
On Monday 10 January 2011 4:28:53 pm [email protected] 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 [email protected]:
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 :)


Reply via email to