You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Faz <ar...@gmail.com> on 2013/11/03 05:14:25 UTC

Re: HandleFault in CXF

I managed to write the xml content to the writer class with the below code,
but am unable to pass this message to the client. I mean even after writing
the message to the xmlwriter class and content being written fine to the
console log, its not been sent to the client. i.e, I dont see the outbound
message being sent nor printed when i turn on the monitors and the
interceptor outbound logs. Could anyone please help me with this?

                *MessageFactory factory = getFactory(message);
                SOAPMessage soapMessage = factory.createMessage();
                SOAPPart soapPart = soapMessage.getSOAPPart();
                SOAPBody soapBody = soapPart.getEnvelope().getBody();  
                SOAPFault soapFault = soapBody.addFault();  
                soapFault.setFaultString("Strange");
    	   W3CDOMStreamWriter writer1 = new SAAJStreamWriter(soapPart);
                message.setContent(XMLStreamWriter.class, writer1);
                message.setContent(SOAPMessage.class, soapMessage);
                message.setContent(Node.class, soapMessage.getSOAPPart());
               
message.getInterceptorChain().add(SAAJOutEndingInterceptor.INSTANCE);*

LOGS:
**saaj the factory **
com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl@146ee9c
**saaj the soapMessage **
com.sun.xml.messaging.saaj.soap.ver1_2.Message1_2Impl@1db52c8
**saaj the soapPart **
com.sun.xml.messaging.saaj.soap.ver1_2.SOAPPart1_2Impl@17d6c1
**saaj the soapsoapBodyPart ** [env:Body: null]
**saaj the soapFault ** [env:Fault: null]
**saaj the setFaultString ** Strange
**saaj the messg ** {org.apache.cxf.message.Message.RESPONSE_CODE=200,
HTTP.RESPONSE=org.apache.catalina.connector.ResponseFacade@2982bf,
org.apache.cxf.headers.Header.list=[], wrote.envelope.start=true,
org.apache.cxf.message.Message.ENCODING=UTF-8,
org.apache.cxf.message.FaultMode=CHECKED_APPLICATION_FAULT,
org.apache.cxf.binding.soap.SoapVersion=org.apache.cxf.binding.soap.Soap12@b16f5f,
Content-Type=application/soap+xml,
org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor.original.xml.writer=[StreamWriter:
class com.ctc.wstx.sw.SimpleNsStreamWriter, underlying outputter:
com.ctc.wstx.sw.BufferingXmlWriter@1144823],
org.apache.cxf.interceptor.LoggingOutInterceptor.log-setup=true,
org.apache.cxf.service.model.BindingFaultInfo=org.apache.cxf.service.model.BindingFaultInfo@106def2}
**saaj the writer1 ** <env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Header/><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text
xml:lang="en-US">Strange</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

Please advise.



--
View this message in context: http://cxf.547215.n5.nabble.com/HandleFault-in-CXF-tp5735813p5735868.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: HandleFault in CXF

Posted by Faz <ar...@gmail.com>.
Any help on this please?



--
View this message in context: http://cxf.547215.n5.nabble.com/HandleFault-in-CXF-Interceptors-tried-possible-options-tp5735813p5735945.html
Sent from the cxf-user mailing list archive at Nabble.com.