Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-545

IllegalArgumentException on AxiomSoap11Body.addFault

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.7
    • Fix Version/s: 1.5.8
    • Component/s: Core
    • Labels:
      None
    • 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.

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            jeremyhare Jeremy Hare
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0d
              0d
              Logged:
              Time Spent - 13m
              13m