Package javax.xml.ws.soap

Examples of javax.xml.ws.soap.SOAPFaultException


        SOAPFactory factory = getSOAPFactory();
        SOAPFault fault = factory.createFault();
        Name qname = factory.createName(localName, prefix, namespace);
        fault.setFaultCode(qname);
        fault.setFaultString(reason);
        return new SOAPFaultException(fault);
    }
View Full Code Here


                                                           null));
        assertNotNull(objContext.getException());
        faultEx = objContext.getException();
        assertTrue("Should be a SOAPFaultException",
                   SOAPFaultException.class.isAssignableFrom(faultEx.getClass()));
        SOAPFaultException sfe = (SOAPFaultException)faultEx;
        SOAPFault sf = sfe.getFault();
        assertNotNull(sf);
    }
View Full Code Here

                } catch (Exception ex) {
                    throw new WebServiceException("error in unmarshal of SOAPFault", ex);
                }
            }
        }
        return new SOAPFaultException(fault);
    }
View Full Code Here

                LOG.log(Level.INFO, "SOAP_FAULT_NO_READER");
                faultObj = reader.read(null, 0, fault);
            }
            if (null == faultObj) {
                LOG.log(Level.INFO, "SOAP_FAULT_UNMARSHALLING_MSG", fault.getElementQName().toString());
                faultObj = new SOAPFaultException(fault);
            }
           
            objContext.setException((Throwable)faultObj);
        } catch (SOAPException se) {
            LOG.log(Level.SEVERE, "SOAP_UNMARSHALLING_FAILURE_MSG", se);
View Full Code Here

        for (StackTraceElement s : cause.getStackTrace()) {
            str.append(s.toString());
            str.append("\n");
        }
       
        SOAPFaultException sfe = createSOAPFaultEx(soapFactory, faultCode, str.toString());
        sfe.initCause(cause);
        return sfe;
    }
View Full Code Here

            sf.setFaultCode(faultCode);
            sf.setFaultString(message);           
        } catch (SOAPException se) {
            se.printStackTrace();           
        }
        return new SOAPFaultException(sf);
    }
View Full Code Here

        try {
            dispImpl.invoke(soapReqMsg);
            fail("Expecting a instance of ProtocolException");
        } catch (ProtocolException pe) {
            assertTrue("Should be instance of SOAPFaultException", pe instanceof SOAPFaultException);
            SOAPFaultException sfe = (SOAPFaultException)pe;
            assertNotNull("Should have a details obj", sfe.getFault());
            assertEquals(
                         new QName("http://schemas.xmlsoap.org/soap/envelope/", "Server"),
                         sfe.getFault().getFaultCodeAsQName());
            assertEquals("Test Exception", sfe.getFault().getFaultString());
        }
        is.close();
    }
View Full Code Here

      DispositionReport report = null;
      if (e instanceof DispositionReportFaultMessage) {
        DispositionReportFaultMessage faultMsg = (DispositionReportFaultMessage) e;
        report = faultMsg.getFaultInfo();
      } else if (e instanceof SOAPFaultException) {
        SOAPFaultException soapFault = (SOAPFaultException) e;
        Detail detail = soapFault.getFault().getDetail();
        if (detail.getFirstChild()!=null) {
          try {
            report =  new DispositionReport(detail.getFirstChild());
          } catch (JAXBException je) {
            log.error("Could not unmarshall detail to a DispositionReport");
View Full Code Here

  private void serializeProtocolException()
    throws WebServiceException
  {
    if (_protocolException instanceof SOAPFaultException) {
      SOAPFaultException sfe = (SOAPFaultException) _protocolException;
      SOAPFault fault = sfe.getFault();

      try {
        MessageFactory factory = _soapContext.getMessageFactory();
        SOAPMessage message = factory.createMessage();
        message.getSOAPBody().addChildElement(fault);
View Full Code Here

            } else if (getBinding() instanceof SOAPBinding) {
                SOAPFault soapFault = createSoapFault((SOAPBinding)getBinding(), ex);
                if (soapFault == null) {
                    throw new WebServiceException(ex);
                }
                SOAPFaultException  exception = new SOAPFaultException(soapFault);
                if (ex instanceof Fault && ex.getCause() != null) {
                    exception.initCause(ex.getCause());
                } else {
                    exception.initCause(ex);
                }
                throw exception;               
            } else {
                throw new WebServiceException(ex);
            }
View Full Code Here

TOP

Related Classes of javax.xml.ws.soap.SOAPFaultException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.