This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

faultCode argument for createFault was passed NULL  RSS feed

Murali Pen
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting the following exception intermittently when the web service returns a fault.

faultCode argument for createFault was passed NULL

I found the following link and it looks like a JAX-WS bug.

So, I added the following code in my client side handler.

public boolean handleFault(SOAPMessageContext smc) {"Inside handleFault");
SOAPMessage message = smc.getMessage();"Inbound SOAP Message with Fault: ");

QName fqn = message.getSOAPBody().getFault().getFaultCodeAsQName();
String namespace = fqn.getNamespaceURI();"fault namespace: " + namespace);

if (namespace == null || namespace.length() == 0){"missing namespace in soap fault: " );
namespace = "";
QName newFqn = new QName(namespace , fqn.getLocalPart());
}catch (Exception ex) {
logger.error("Cannot modify Soap Fault: " , ex);

return true;

I have 2 questions.

1) In the above code, is it correct to set the fault namespace to I read it somewhere else that SOAP fault should have an empty namespace. Is this correct?

2) I am getting a NullPointerException in the line that has the code when fault is returned by the web service.


I would appreciate if someone can help me. Thanks in advance.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!