[SWS-545] IllegalArgumentException on AxiomSoap11Body.addFault Created: 27/Jul/09  Updated: 04/May/12  Resolved: 02/Aug/09

Status: Closed
Project: Spring Web Services
Component/s: Core
Affects Version/s: 1.5.7
Fix Version/s: 1.5.8

Type: Bug Priority: Major
Reporter: Jeremy Hare Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 13m
Original Estimate: Not Specified
Environment:

OC4J 10.1.3.3
spring ws 1.5.7
axiom 1.2.8
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)



 Description   

I have created a custom ExceptionResolver below:

MyExceptionResolver .java

public class MyExceptionResolver  extends AbstractSoapFaultDefinitionExceptionResolver {
	@Override
protected SoapFaultDefinition getFaultDefinition(Object endpoint,
		Exception ex) {		
	QName messageDeliveryFaultQName = new QName(INVOKER_NS_URI, "MessageDeliveryFault", "invoker");
	QName messageDeliveryFaultQNameNOPREFIX = new QName(INVOKER_NS_URI, "MessageDeliveryFault");
 
	if (ex instanceof WebServiceTransportException) {
		SoapFaultDefinition soapFaultDefinition = new SoapFaultDefinition();
		soapFaultDefinition.setFaultCode(messageDeliveryFaultQNameNOPREFIX );
			
		soapFaultDefinition.setFaultStringOrReason(ex.getMessage());	
		return soapFaultDefinition;
	}
	return null;
}
}

if I use the messageDeliveryFaultQNameNOPREFIX Qname as the fault code I get:

java.lang.IllegalArgumentException: Could not resolve namespace of code [{urn:www.thiess.com.au:services:eProcurement:QuadremInvoker:v1}MessageDeliveryFault]
	at org.springframework.ws.soap.axiom.AxiomSoap11Body.setValueText(AxiomSoap11Body.java:117)
	at org.springframework.ws.soap.axiom.AxiomSoap11Body.addFault(AxiomSoap11Body.java:92)
	at org.springframework.ws.soap.server.endpoint.AbstractSoapFaultDefinitionExceptionResolver.resolveExceptionInternal(AbstractSoapFaultDefinitionExceptionResolver.java:89)
	at org.springframework.ws.server.endpoint.AbstractEndpointExceptionResolver.resolveException(AbstractEndpointExceptionResolver.java:106)
	at org.springframework.ws.server.MessageDispatcher.processEndpointException(MessageDispatcher.java:311)
	at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:235)
	at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:168)
	at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
	at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
	at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:463)

The other Qname with a prefix works fine.



 Comments   
Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Mon Dec 11 01:54:49 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.