You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jose Miguel Sanchez Martin <jo...@swissrisk.com> on 2008/02/05 17:20:03 UTC
Question about faults
Hi,
I have a web service client and server based based on the axiom API. The WSDL for this web service has an operation with input, output and fault parts.
On the server side I generate a fault by doing the following:
public void invokeBusinessLogic(
MessageContext requestCtx,
MessageContext responseCtx)
throws AxisFault
{
[...]
SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
OMElement body = envelope.getBody();
if (isThisAFault()) {
SOAPFault fault = soapFactory.createSOAPFault();
envelope.getBody().addFault(fault);
body = fault;
}
OMElement payload = buildMessage(body,...);
responseCtx.setProcessingFault(true); // is this required?
responseCtx.setEnvelope(envelope);
}
On the client side the onError method of the AxisCallback class is invoked, but I was expecting that the onFault method would be invoked. The stacktrace of the exception in the onError method is this:
org.apache.axis2.AxisFault
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
at org.apache.axis2.description.OutInAxisOperationClient$NonBlockingInvocationWorker.run(OutInAxisOperation.java:414)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)
Am I generating the fault properly? Could you please give me a hint about where the problem is located?
Many thanks in advance,
jms.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org