SOAPFaultException thrown from @WebServiceProvider class is not correctly 
populated
-----------------------------------------------------------------------------------

                 Key: CXF-1458
                 URL: https://issues.apache.org/jira/browse/CXF-1458
             Project: CXF
          Issue Type: Bug
          Components: JAX-WS Runtime
    Affects Versions: 2.0.4, 2.0.5
         Environment: Windows XP, JDK1.5.0_12, Tomcat 5.5.25
            Reporter: Steve Wu


My issue is similar to cxf-1417. I downloaded cxf 2.0.5 (2-22-08) but it 
doesn't solved my problem.


@WebServiceProvider()
@ServiceMode(value = Service.Mode.PAYLOAD)

public class TestGreetingProvider
  implements Provider<DOMSource>
{
    @Resource
    private WebServiceContext context;
    //~ Constructors 
-------------------------------------------------------------------------------

    public TestGreetingProvider()
    {
    }

    //~ Methods 
------------------------------------------------------------------------------------

    public DOMSource invoke(DOMSource request)
    {
        try
        {
            // do some thing
        }
        catch(Exception e)
        {
            
             SOAPFactory factory = SOAPFactory.newInstance();
             SOAPFault soapFault = factory.createFault();   
            
             soapFault.setFaultString("Test Fault String ****");

             Detail detail = soapFault.addDetail();
             detail = soapFault.getDetail();

             QName qName = new 
QName("http://www.Hello.org/greeter","TestFault","ns";);
             DetailEntry de = detail.addDetailEntry(qName);            

             qName = new QName("http://www.Hello.org/greeter","ErrorCode","ns";);
             SOAPElement errorElement = de.addChildElement(qName);
             errorElement.setTextContent("errorcode");   
                       
             throw new SOAPFaultException(soapFault);
        
        }
        // return DOMSource here
    }
}  

I am expecting the following fault message in the client:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
    <soapenv:Body>
      <soapenv:Fault>       
        <faultstring>Test Fault String ****</faultstring>
        <detail>
          <ns:TestFault xmlns:ns="http://www.Hello.org/greeter";>
            <ns:ErrorCode 
xmlns:ns="http://www.Hello.org/greeter";>errorcode</ErrorCode>            
          </ns:TestFault>
        </detail>
      </soapenv:Fault>
    </soapenv:Body>
  </soapenv:Envelope>
  
  
But I got the following in the client when using cxf 2.0.4. NOTE: The detail 
section is missing. 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
    <soapenv:Body>
      <soapenv:Fault>      
      <faultcode>soap:Server</faultcode> 
        <faultstring>Test Fault String ****</faultstring>        
      </soapenv:Fault>
    </soapenv:Body>
  </soapenv:Envelope>
  
  
If I use cxf 2.0.5(2-22-08) I didn't see any response in my TCPMonitor.  


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to