4 Replies Latest reply on Feb 8, 2012 4:24 AM by Poyan Gerami


    Poyan Gerami Novice



      We are migrating from JBoss 5 to JBoss 6.1 and the webservice stack is changes to cxf we have following problem.

      We have a webservice client when geting soapufault from backend we catch javax.xml.ws.soap.SOAPFaultException,

      catch (final SOAPFaultException se) {



      se does not contains mutch.


      when i debug JBoss i see that se contains cause = org.apache.cxf.binding.soap.SoapFault: Kunduppgifter saknas

      I need that object to get the role, code and message from that object.


      Is it possible in some way ?

        • 1. Re: SoapFault
          Jim Ma Apprentice

          You need to create the soapFault with role, code and cause and throw it in a soapFaultExceptoin in the backend:

                          SOAPFactory factory = SOAPFactory.newInstance();
                          SOAPFault fault = factory.createFault("foo,
                                                                new QName("http://foo", "FooCode"));
                          //set code role, deatil 
                          throw new SOAPFaultException(fault);

          Is this what you need ?

          • 2. Re: SoapFault
            Poyan Gerami Novice

            The usecase is this:


            1) I call the a backend webservice.

            2) I see on the wire i get this fault:


            <faultstring>Kunduppgifter saknas</faultstring>



            3) In my client code I get SOAPFaultException


            Inside SOAPFaultException (cause) i have org.apache.cxf.binding.soap.SoapFault. I need that object for getting role, code and message. I see that thay contains:


            role  =   "KIS_Backend"

            code = "00001"

            faultstring = "Kunduppgifter saknas"



            So the main problem is that i I can not get all the fault information from backend. SOAPFaultException hase not the role and the code.

            • 3. Re: SoapFault
              Poyan Gerami Novice

              hear is some debug information. shold't cxf mapp the fault to the SOAPFault ? evrything seams to be null hear.


              SOAPFault soapFault = se.getFault();


              soapFault = {com.sun.xml.internal.messaging.saaj.soap.ver1_1.Fault1_1Impl@686}"[SOAP-ENV:Fault: null]"

              faultStringElement = {com.sun.xml.internal.messaging.saaj.soap.ver1_1.FaultElement1_1Impl@697}"[faultstring: null]"

              faultActorElement = {com.sun.xml.internal.messaging.saaj.soap.ver1_1.FaultElement1_1Impl@698}"[faultactor: null]"

              faultCodeElement = {com.sun.xml.internal.messaging.saaj.soap.ver1_1.FaultElement1_1Impl@699}"[faultcode: null]"

              detail = null

              encodingStyleAttribute = {com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl$AttributeManager@700}

              elementQName = {javax.xml.namespace.QName@701}"{http://schemas.xmlsoap.org/soap/envelope/}Fault"

              namespaceURI = {java.lang.String@702}"http://schemas.xmlsoap.org/soap/envelope/"

              localName = {java.lang.String@703}"Fault"

              type = null

              name = {java.lang.String@704}"SOAP-ENV:Fault"

              attributes = {com.sun.org.apache.xerces.internal.dom.AttributeMap@705}

              ownerDocument = {com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl@707}"[#document: null]"

              firstChild = {com.sun.xml.internal.messaging.saaj.soap.ver1_1.FaultElement1_1Impl@699}"[faultcode: null]"

              fNodeListCache = null

              fBufferStr = null

              previousSibling = null

              nextSibling = null

              ownerNode = {com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl@707}"[#document: null]"

              • 4. Re: SoapFault
                Poyan Gerami Novice

                The problem was on my part. soapFault actually contains the value of role, code and message. I misinterpreted what debugger meand by null (I think the null is only the qualified name) , the content was not null.