Does WCF FaultException<T> support interop with a Java web service Fault

早过忘川 提交于 2019-12-01 00:48:08

WCF should work with axis2 exceptions. I had it working, but I don't remember all the details.

When you use SOAP monitor or something like that, what do you see in the fault message body?

If you're not catching the FaultException<T>, that means you're likely not sending it. Be careful of the XML namespace being used. Take a look at what you're sending, using Fiddler or something like it.

FaultException<T> works fine with Java, or even with WCF.

Thanks john you set me on the right path, Problem was obvious: I was not setting the detail when I threw the fault in java (axis2).

DODGY CODE:

throw new SimpleException("SimpleFault thrown");

WORKING CODE:

 SimpleFault fault = new SimpleFault();
 fault.setReason("SimpleFault reason");

 SimpleFaultE faultMessage = new SimpleFaultE();
 faultMessage.setSimpleFault(fault);

 SimpleException ex = new SimpleException("SimpleFault thrown");
 ex.setFaultMessage(faultMessage);

 throw ex;

So AXIS2 -> WCF wsdl:fault interop works just fine...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!