Hi,

I am using CXF version 2.0.4-incubator in an application that implements
the JAX-WS Provider<Source> interface. The application throws a
SOAPFaultException on error, but the client gets the HTTP message below,
which does not have a SOAP Envelope and hence cannot be parsed.  

The code snippet that throws the SOAPFaultException is also included.
What's the right way of creating and throwing a SOAPFaultException? 

<snip>
            Message errMessage = new Message("UNEXPECTED_ERROR", BUNDLE,
e.getMessage());
            LOG.error(errMessage, e);
            Fault fault = new Fault(errMessage));
            SOAPFault soapFault =
SOAPFactory.newInstance().createFault();
            soapFault.setFaultCode(fault.getFaultCode());
            soapFault.setFaultString(fault.getMessage());
            throw new SOAPFaultException(soapFault);
<snip>

<snip>
--------------------------------------
Feb 28, 2008 1:03:57 PM org.apache.cxf.interceptor.LoggingInInterceptor
logging
INFO: Inbound Message
----------------------------
Encoding: UTF-8
Headers: {Content-Length=[342], Server=[Jetty(6.1.6)],
content-type=[text/xml; c
harset=utf-8]}
Messages:
Message:

Payload: <ns1:Fault
xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/";><faultcode
xmlns:ns2="http://cxf.apache.org/faultcode";>ns2:server</faultcode><fault
string>Invalid Request Message: [Line: -1, Column: -1: Empty XML
response from validation script:
identity.xslt].</faultstring></ns1:Fault>
--------------------------------------
<snip>


Regards,
Dhiraj. 

Dhiraj Bokde
Principal Consultant
[EMAIL PROTECTED]
----------------------------------------------------------
IONA Technologies PLC
1-800-ORBIX-4U
http://www.iona.com
Making Software Work Together
----------------------------------------------------------

Reply via email to