Package javax.xml.ws.soap

Examples of javax.xml.ws.soap.SOAPFaultException


            }
            if (soapFault == null) {
                return new WebServiceException(ex);
            }
           
            SOAPFaultException  exception = new SOAPFaultException(soapFault);
            exception.initCause(ex);
            return exception;               
        }
        return new WebServiceException(ex);
    }
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

                body.removeContents();

                SOAPFault soapFault = body.addFault();

                if (exception instanceof SOAPFaultException) {
                    SOAPFaultException sf = (SOAPFaultException)exception;
                    soapFault.setFaultString(sf.getFault().getFaultString());
                    soapFault.setFaultCode(sf.getFault().getFaultCodeAsQName());
                    soapFault.setFaultActor(sf.getFault().getFaultActor());
                    if (sf.getFault().hasDetail()) {
                        Node nd = originalMsg.getSOAPPart().importNode(
                                                                       sf.getFault().getDetail()
                                                                           .getFirstChild(), true);
                        soapFault.addDetail().appendChild(nd);
                    }
                } else if (exception instanceof Fault) {
                    SoapFault sf = SoapFault.createFault((Fault)exception, ((SoapMessage)message)
                        .getVersion());
                    soapFault.setFaultString(sf.getReason());
                    soapFault.setFaultCode(sf.getFaultCode());
                    if (sf.hasDetails()) {
                        soapFault.addDetail();
                        Node nd = originalMsg.getSOAPPart().importNode(sf.getDetail(), true);
                        nd = nd.getFirstChild();
                        while (nd != null) {
                            soapFault.getDetail().appendChild(nd);
                            nd = nd.getNextSibling();
                        }
View Full Code Here

   
    private void throwUnsupportedOperation(String string) {
        try {
            SOAPFault fault = SAAJFactoryResolver.createSOAPFactory(null).createFault();
            fault.setFaultString("Unsupported operation " + string);
            throw new SOAPFaultException(fault);
        } catch (SOAPException e) {
            throw new Fault(e);
        }
    }
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

            SOAPBody body = soapMessage.getSOAPBody();
            SOAPFault soapFault = body.addFault();

            if (exception instanceof SOAPFaultException) {
                SOAPFaultException sf = (SOAPFaultException)exception;
                soapFault.setFaultString(sf.getFault().getFaultString());
                soapFault.setFaultCode(sf.getFault().getFaultCode());
                soapFault.setFaultActor(sf.getFault().getFaultActor());
                if (sf.getFault().hasDetail()) {
                    Node nd = soapMessage.getSOAPPart().importNode(sf.getFault().getDetail(),
                                                                   true);
                    nd = nd.getFirstChild();
                    soapFault.addDetail();
                    while (nd != null) {
                        soapFault.getDetail().appendChild(nd);
                        nd = nd.getNextSibling();
                    }
                }
            } else if (exception instanceof Fault) {
                SoapFault sf = SoapFault.createFault((Fault)exception, ((SoapMessage)msg).getVersion());
                soapFault.setFaultString(sf.getReason());
                soapFault.setFaultCode(sf.getFaultCode());
                if (sf.hasDetails()) {
                    soapFault.addDetail();
                    Node nd = soapMessage.getSOAPPart().importNode(sf.getDetail(), true);
                    nd = nd.getFirstChild();
                    while (nd != null) {
                        soapFault.getDetail().appendChild(nd);
                        nd = nd.getNextSibling();
                    }
View Full Code Here

                                                                 new Exception(error.toString()));
                } catch (SOAPException e) {
                    //ignore
                }
                if (soapFault != null) {
                    throw new SOAPFaultException(soapFault);
                }
            } else if (getBinding() instanceof HTTPBinding) {
                HTTPException exception = new HTTPException(HttpURLConnection.HTTP_INTERNAL_ERROR);
                exception.initCause(new Exception(error.toString()));
                throw exception;
View Full Code Here

            }
            if (soapFault == null) {
                return new WebServiceException(ex);
            }
           
            SOAPFaultException  exception = new SOAPFaultException(soapFault);
            exception.initCause(ex);
            return exception;               
        }
        return new WebServiceException(ex);
    }
View Full Code Here

    }
   
    @Override
    protected Fault createFault(Throwable ex, Method m, List<Object> params, boolean checked) {
        //map the JAX-WS faults
        SOAPFaultException sfe = findSoapFaultException(ex);
        if (sfe != null) {
            SoapFault fault = new SoapFault(sfe.getFault().getFaultString(),
                                            ex,
                                            sfe.getFault().getFaultCodeAsQName());
            fault.setRole(sfe.getFault().getFaultActor());
            if (sfe.getFault().hasDetail()) {
                fault.setDetail(sfe.getFault().getDetail());
            }
           
            return fault;
        }
        return super.createFault(ex, m, params, checked);
View Full Code Here

        if (f == null) {
            return;
        }
        try {
            if (f.getCause().getClass().equals(SOAPFaultException.class)) {
                SOAPFaultException sf = (SOAPFaultException) (f.getCause());
                if (f instanceof SoapFault) {
                    for (Iterator<QName> it = CastUtils.cast(sf.getFault().getFaultSubcodes()); it.hasNext();) {
                        ((SoapFault) f).addSubCode(it.next());   
                    }
                }
                if (sf.getFault().getFaultReasonLocales().hasNext()) {
                    Locale lang = (Locale) sf.getFault()
                           .getFaultReasonLocales().next();
                    String convertedLang = lang.getLanguage();
                    String country = lang.getCountry();
                    if (country.length() > 0) {
                        convertedLang = convertedLang + '-' + country;
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.