Announcement Announcement Module
Collapse
No announcement yet.
Capture soap fault detail from service provider Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Capture soap fault detail from service provider

    Hi,

    I have a Spring ws 1.5.6 deployed on WAS 6.1.
    This Spring Webservice has a spring ws client inside which calls a service hosted on WAS.

    So the flow looks like ClientA --> Spring WS --> Spring WS client --> WAS service

    My requirement is capture the SoapFault (with detail) from the WAS service and send it as is to ClientA.

    Problem: The detail tag is chugged when it reaches ClientA.

    I tried to override the customizeFault method in SoapFaultMappingExceptionResolver, but couldn't iterate over all elements in
    the detail tag from soapfault returned from WAS service. It returns only the top element in the detail tag. Please refer code below.

    My question
    1) Is this the only way to do it?
    2) If yes, for #1, please help in the solution to iterate over all elements in



    Code:
    protected void customizeFault(Object endpoint, Exception ex, SoapFault fault)
    	{
    		super.customizeFault(endpoint, ex, fault);
    		SoapFaultClientException soapEx = (SoapFaultClientException) ex;
    		SoapFaultDetail detail = fault.addFaultDetail();
    		//detail = soapEx.getSoapFault().getFaultDetail();
    
    		Iterator it = soapEx.getSoapFault().getFaultDetail().getDetailEntries();
    		while(it.hasNext())
    		{
    			SoapFaultDetailElement el = (SoapFaultDetailElement)it.next();
    			System.out.println(el);
    			System.out.println(el.getName());
    				
    		}
    	}
Working...
X