Package org.apache.cxf.binding.soap

Examples of org.apache.cxf.binding.soap.SoapFault


        if (!passed) {
            String reason = BUNDLE.getString("INVALID_ADDRESSING_PROPERTY_MESSAGE");
            QName detail = "ANONYMOUS".equals(addressingResponses)
                ? Names.ONLY_ANONYMOUS_ADDRESS_SUPPORTED_QNAME
                : Names.ONLY_NONANONYMOUS_ADDRESS_SUPPORTED_QNAME;
            throw new SoapFault(reason, detail);
        }           
    }
View Full Code Here


        if (!message.getExchange().isOneWay()
            && !MessageUtils.isPartialResponse(message)
            && ContextUtils.isNoneAddress(maps.getReplyTo())) {
            String reason = MessageFormat.format(BUNDLE.getString("REPLYTO_NOT_SUPPORTED_MSG"),
                                                 maps.getReplyTo().getAddress().getValue());
            throw new SoapFault(reason,
                                new QName(Names.WSA_NAMESPACE_NAME,
                                          Names.WSA_NONE_ADDRESS));
        }
    }
View Full Code Here

            node = (String) xu.getValue("//s:Fault/s:Node/text()",
                                        fault,
                                        XPathConstants.STRING);                      
        } catch (XMLStreamException e) {
            throw new SoapFault("Could not parse message.",
                                e,
                                message.getVersion().getSender());
        }
        // if the fault's content is invalid and fautlCode is not found, blame the receiver
        if (faultCode == null) {
            faultCode = Soap12.getInstance().getReceiver();
            exMessage = new Message("INVALID_FAULT", LOG).toString();
        }
       
        SoapFault fault = new SoapFault(exMessage, faultCode);
        fault.setSubCodes(subCodes);
        fault.setDetail(detail);
        fault.setRole(role);
        fault.setNode(node);
        return fault;
    }
View Full Code Here

                    WSSecHeader secHeader = new WSSecHeader(actor, mustUnderstand);
                    Element el = null;
                    try {
                        el = secHeader.insertSecurityHeader(saaj.getSOAPPart());
                    } catch (WSSecurityException e) {
                        throw new SoapFault(
                            new Message("SECURITY_FAILED", LOG), e, message.getVersion().getSender()
                        );
                    }
                    try {
                        //move to end
View Full Code Here

     * @param namespace the fault namespace
     * @param reason the fault reason
     * @return a new SoapFault
     */
    private SoapFault createSOAPFaut(String localName, String namespace, String reason) {
        return new SoapFault(reason, new QName(namespace, localName));
    }
View Full Code Here

                setUpMessageProperty(message,
                                     REQUESTOR_ROLE,
                                     Boolean.FALSE);
               
                if (args.fault) {
                    message.setContent(Exception.class, new SoapFault("blah",
                            new Exception(), Fault.FAULT_CODE_SERVER));
                    expectedAction = "http://foo/bar/SEI/op/Fault/Exception";
                } else {
                    expectedAction = "http://foo/bar/SEI/opResponse";
                }
View Full Code Here

            }
            msg.put(SECURITY_PROCESSED, Boolean.TRUE);

        } catch (WSSecurityException e) {
            LOG.log(Level.WARNING, "", e);
            SoapFault fault = createSoapFault(msg, version, e);
            throw fault;
        } catch (XMLStreamException e) {
            throw new SoapFault(new Message("STAX_EX", LOG), e, version.getSender());
        } catch (SOAPException e) {
            throw new SoapFault(new Message("SAAJ_EX", LOG), e, version.getSender());
        } finally {
            reqData.clear();
            reqData = null;
        }
    }
View Full Code Here

        if (action == null) {
            action = (String)msg.get(WSHandlerConstants.ACTION);
        }
        if (action == null) {
            LOG.warning("No security action was defined!");
            throw new SoapFault("No security action was defined!", version.getReceiver());
        }
        return action;
    }
View Full Code Here

     * Otherwise set the Fault/Code/Value to env:Sender and the Fault/Code/Subcode/Value
     * as the fault code from the WSSecurityException.
     */
    private SoapFault
    createSoapFault(org.apache.cxf.message.Message message, SoapVersion version, WSSecurityException e) {
        SoapFault fault;
        String errorMessage = null;
        if (MessageUtils.isRequestor(message)) {
            errorMessage = e.getMessage();
        } else {
            errorMessage = WSS4JUtils.getSafeExceptionMessage(e);
            if (errorMessage == null) {
                errorMessage = e.getMessage();
            }
        }
       
        javax.xml.namespace.QName faultCode = e.getFaultCode();
        if (version.getVersion() == 1.1 && faultCode != null) {
            fault = new SoapFault(errorMessage, e, faultCode);
        } else {
            fault = new SoapFault(errorMessage, e, version.getSender());
            if (version.getVersion() != 1.1 && faultCode != null) {
                fault.setSubCode(faultCode);
            }
        }
        return fault;
    }
View Full Code Here

                    WSSecHeader secHeader = new WSSecHeader(actor, mustUnderstand);
                    Element el = null;
                    try {
                        el = secHeader.insertSecurityHeader(saaj.getSOAPPart());
                    } catch (WSSecurityException e) {
                        throw new SoapFault(
                            new Message("SECURITY_FAILED", LOG), e, message.getVersion().getSender()
                        );
                    }
                    try {
                        //move to end
View Full Code Here

TOP

Related Classes of org.apache.cxf.binding.soap.SoapFault

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.