Mary Ryllo
Mary Ryllo

Reputation: 2371

JAX-WS: com.sun.xml.messaging.saaj.SOAPExceptionImpl: No NamespaceURI, SOAP requires faultcode content to be a QName

I'm performing a SOAP request via SSL. One request is working, but another request for same SOAP service fails with this exception:

java.lang.reflect.UndeclaredThrowableException
    com.sun.proxy.$Proxy980.initPayment2(Unknown Source)
    com.mobimoney.emulator.rostelecom.utils.LogicImpl.executeInitPayment2(LogicImpl.java:76)
    com.mobimoney.emulator.rostelecom.servlets.InitPaymentPageServlet.execInitPayment(InitPaymentPageServlet.java:56)
    com.mobimoney.emulator.rostelecom.servlets.InitPaymentPageServlet.service(InitPaymentPageServlet.java:24)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
com.sun.xml.messaging.saaj.SOAPExceptionImpl: No NamespaceURI, SOAP requires faultcode content to be a QName
    com.sun.xml.messaging.saaj.soap.impl.FaultImpl.setFaultCode(FaultImpl.java:155)
    com.sun.xml.messaging.saaj.soap.impl.FaultImpl.setFaultCode(FaultImpl.java:171)
    org.apache.cxf.jaxws.JaxWsClientProxy.createSoapFault(JaxWsClientProxy.java:208)
    org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:142)
    com.sun.proxy.$Proxy980.initPayment2(Unknown Source)
    com.mobimoney.emulator.rostelecom.utils.LogicImpl.executeInitPayment2(LogicImpl.java:76)
    com.mobimoney.emulator.rostelecom.servlets.InitPaymentPageServlet.execInitPayment(InitPaymentPageServlet.java:56)
    com.mobimoney.emulator.rostelecom.servlets.InitPaymentPageServlet.service(InitPaymentPageServlet.java:24)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

I can't understand what's going wrong. I've Googled this exception and didn't find anything useful. Maybe this is a problem in WSDL or how I generated classes from WSDL?

Upvotes: 1

Views: 958

Answers (1)

Necreaux
Necreaux

Reputation: 9776

This is a bug in SAAJ, the Java SOAP library being used.

In an error response, the SOAP "faultcode" value is supposed to be formatted in a qname (prefix:localName) format. Older versions of SAAJ enforce this too strictly, giving this error if the prefix is blank. Upgrading to 1.3.16 fixes this issue.

See: https://github.com/javaee/metro-saaj/issues/47

Upvotes: 1

Related Questions