Package org.springframework.ws.soap

Examples of org.springframework.ws.soap.SoapFaultDetailElement


            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);
                }
            }
        }
        return false;
    }
View Full Code Here


            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());
                }
            }
        }
        return false;
    }
View Full Code Here

        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);
        detailContents = new StringSource("<detailContents xmlns='namespace'/>");
        transformer.transform(detailContents, detailElement2.getResult());
        assertPayloadEqual(
                "<SOAP-ENV:Fault xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:spring='http://www.springframework.org'>" +
                        "<faultcode>spring:fault</faultcode>" + "<faultstring>" + faultString + "</faultstring>" +
                        "<detail>" +
                        "<spring:detailEntry xmlns:spring='http://www.springframework.org'><detailContents xmlns='namespace'/></spring:detailEntry>" +
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();
        transformer.transform(fault.getSource(), result);
        assertXMLEqual("Invalid source for body",
                "<soapenv:Fault xmlns:soapenv='http://www.w3.org/2003/05/soap-envelope'>" +
                        "<soapenv:Code><soapenv:Value>" + soapBody.getName().getPrefix() + ":Receiver</soapenv:Value>" +
View Full Code Here

        soapFault.setFaultString(fault.getFaultStringOrReason());

        if (fault.getFaultDetail() != null) {
            Iterator<SoapFaultDetailElement> details = fault.getFaultDetail().getDetailEntries();
            while (details.hasNext()) {
                SoapFaultDetailElement soapFaultDetailElement = details.next();
                soapFault.addFaultDetail(extractFaultDetail(soapFaultDetailElement));
            }
        }

        return soapFault;
View Full Code Here

TOP

Related Classes of org.springframework.ws.soap.SoapFaultDetailElement

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.