Package org.springframework.ws.soap

Examples of org.springframework.ws.soap.SoapFault.addFaultDetail()


        if (messageContext.getResponse() instanceof SoapMessage) {
            SoapMessage response = (SoapMessage) messageContext.getResponse();
            SoapBody body = response.getSoapBody();
            SoapFault fault = body.addClientOrSenderFault(getFaultStringOrReason(), getFaultLocale());
            if (getAddValidationErrorDetail()) {
                SoapFaultDetail detail = fault.addFaultDetail();
                for (ObjectError objectError : errors.getAllErrors()) {
                    String msg = messageSource.getMessage(objectError, getFaultLocale());
                    SoapFaultDetailElement detailElement = detail.addFaultDetailElement(getDetailElementName());
                    detailElement.addText(msg);
                }
View Full Code Here


        if (messageContext.getResponse() instanceof SoapMessage) {
            SoapMessage response = (SoapMessage) messageContext.getResponse();
            SoapBody body = response.getSoapBody();
            SoapFault fault = body.addClientOrSenderFault(getFaultStringOrReason(), getFaultStringOrReasonLocale());
            if (getAddValidationErrorDetail()) {
                SoapFaultDetail detail = fault.addFaultDetail();
                for (SAXParseException error : errors) {
                    SoapFaultDetailElement detailElement = detail.addFaultDetailElement(getDetailElementName());
                    detailElement.addText(error.getMessage());
                }
            }
View Full Code Here

    @Test
    public void testAddFaultWithDetail() throws Exception {
        QName faultCode = new QName("http://www.springframework.org", "fault", "spring");
        String faultString = "faultString";
        SoapFault fault = ((Soap11Body) soapBody).addFault(faultCode, faultString, null);
        SoapFaultDetail detail = fault.addFaultDetail();
        QName detailName = new QName("http://www.springframework.org", "detailEntry", "spring");
        SoapFaultDetailElement detailElement1 = detail.addFaultDetailElement(detailName);
        StringSource detailContents = new StringSource("<detailContents xmlns='namespace'/>");
        transformer.transform(detailContents, detailElement1.getResult());
        SoapFaultDetailElement detailElement2 = detail.addFaultDetailElement(detailName);
View Full Code Here

    @Test
    public void testAddFaultWithDetailResult() throws Exception {
        SoapFault fault = ((Soap11Body) soapBody)
                .addFault(new QName("namespace", "localPart", "prefix"), "Fault", null);
        SoapFaultDetail detail = fault.addFaultDetail();
        transformer.transform(new StringSource("<detailContents xmlns='namespace'/>"), detail.getResult());
        transformer.transform(new StringSource("<detailContents xmlns='namespace'/>"), detail.getResult());
        assertPayloadEqual("<SOAP-ENV:Fault xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>" +
                "<faultcode xmlns:prefix='namespace'>prefix:localPart</faultcode>" +
                "<faultstring>Fault</faultstring>" + "<detail>" + "<detailContents xmlns='namespace'/>" +
View Full Code Here

    }

    @Test
    public void testAddFaultWithDetail() throws Exception {
        SoapFault fault = soapBody.addServerOrReceiverFault("faultString", Locale.ENGLISH);
        SoapFaultDetail detail = fault.addFaultDetail();
        SoapFaultDetailElement detailElement =
                detail.addFaultDetailElement(new QName("namespace", "localPart", "prefix"));
        StringSource detailContents = new StringSource("<detailContents xmlns='namespace'/>");
        transformer.transform(detailContents, detailElement.getResult());
        StringResult result = new StringResult();
View Full Code Here

    }

    @Test
    public void testAddFaultWithDetailResult() throws Exception {
        SoapFault fault = soapBody.addServerOrReceiverFault("faultString", Locale.ENGLISH);
        SoapFaultDetail detail = fault.addFaultDetail();
        transformer.transform(new StringSource("<detailContents xmlns='namespace'/>"), detail.getResult());
        transformer.transform(new StringSource("<detailContents xmlns='namespace'/>"), detail.getResult());
        StringResult result = new StringResult();
        transformer.transform(fault.getSource(), result);
        assertXMLEqual("Invalid source for body",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.