Examples of Detail


Examples of javax.xml.soap.Detail

        Assert.assertTrue("Response has no fault", response.getSOAPBody().hasFault());
        SOAPFault fault = response.getSOAPBody().getFault();
        Assert.assertEquals("Invalid fault code", new QName("http://schemas.xmlsoap.org/soap/envelope/", "Client"),
                fault.getFaultCodeAsQName());
        Assert.assertEquals("Invalid fault string", endpoint.getFaultStringOrReason(), fault.getFaultString());
        Detail detail = fault.getDetail();
        Assert.assertNotNull("No detail", detail);
        Iterator<?> iterator = detail.getDetailEntries();
        Assert.assertTrue("No detail entry", iterator.hasNext());
        DetailEntry detailEntry = (DetailEntry) iterator.next();
        Assert.assertEquals("Invalid detail entry name",
                new QName("http://springframework.org/spring-ws", "ValidationError"), detailEntry.getElementQName());
        Assert.assertEquals("Invalid detail entry text", "Name is required", detailEntry.getTextContent());
View Full Code Here

Examples of javax.xml.soap.Detail

        return getSaajElement();
    }

    @Override
    public SoapFaultDetail getFaultDetail() {
        Detail saajDetail = getSaajFault().getDetail();
        return saajDetail != null ? new SaajSoapFaultDetail(saajDetail) : null;
    }
View Full Code Here

Examples of javax.xml.soap.Detail

    }

    @Override
    public SoapFaultDetail addFaultDetail() {
        try {
            Detail saajDetail = getSaajFault().addDetail();
            return new SaajSoapFaultDetail(saajDetail);
        }
        catch (SOAPException ex) {
            throw new SaajSoapFaultException(ex);
        }
View Full Code Here

Examples of javax.xml.soap.Detail

                    soapFault.setFaultActor(fault.getRole());
                }
                if (fault.getDetail() != null
                    && fault.getDetail().getFirstChild() != null) {
                   
                    Detail detail = null;
                    Node child = fault.getDetail().getFirstChild();
                    while (child != null) {
                        if (Node.ELEMENT_NODE == child.getNodeType()) {
                            if (detail == null) {
                                detail = soapFault.addDetail();
                            }
                            Node importedChild = soapMessage.getSOAPPart().importNode(child, true);
                            detail.appendChild(importedChild);
                        }
                        child = child.getNextSibling();
                    }
                }
View Full Code Here

Examples of javax.xml.soap.Detail

                    soapFault.setFaultActor(fault.getRole());
                }
                if (fault.getDetail() != null
                    && fault.getDetail().getFirstChild() != null) {
                   
                    Detail detail = null;
                    Node child = fault.getDetail().getFirstChild();
                    while (child != null) {
                        if (Node.ELEMENT_NODE == child.getNodeType()) {
                            if (detail == null) {
                                detail = soapFault.addDetail();
                            }
                            Node importedChild = soapMessage.getSOAPPart().importNode(child, true);
                            detail.appendChild(importedChild);
                        }
                        child = child.getNextSibling();
                    }
                }
View Full Code Here

Examples of javax.xml.soap.Detail

            assertNotNull(fault);
            assertEquals(new QName(SOAPConstants.URI_NS_SOAP_ENVELOPE, "Server"),
                         fault.getFaultCodeAsQName());
            assertEquals("http://gizmos.com/orders", fault.getFaultActor());
           
            Detail detail = fault.getDetail();
            assertNotNull(detail);
           
            QName nn = new QName("http://gizmos.com/orders/", "order");
            Iterator<Element> it = CastUtils.cast(detail.getChildElements(nn));
            assertTrue(it.hasNext());
            Element el = it.next();
            el.normalize();
            assertEquals("Quantity element does not have a value", el.getFirstChild().getNodeValue());
            el = it.next();
View Full Code Here

Examples of javax.xml.soap.Detail

               
                soapFault.setFaultCode(faultCode);
                soapFault.setFaultString(faultString);
                soapFault.setFaultActor(faultActor);

                Detail faultDetail = soapFault.addDetail();

                SOAPElement dispRpt = faultDetail.addChildElement("dispositionReport", "", IRegistry.UDDI_V2_NAMESPACE);
                dispRpt.setAttribute("generic", IRegistry.UDDI_V2_GENERIC);
                dispRpt.setAttribute("operator", Config.getOperator());

                SOAPElement result = dispRpt.addChildElement("result");
                result.setAttribute("errno", errno);
View Full Code Here

Examples of javax.xml.soap.Detail

    private static Block[] getDetailBlocks(javax.xml.soap.SOAPFault soapFault)
            throws WebServiceException {
        try {
            Block[] blocks = null;
            Detail detail = soapFault.getDetail();
            if (detail != null) {
                // Get a SAAJ->OM converter
                SAAJConverterFactory converterFactory = (SAAJConverterFactory)FactoryRegistry
                        .getFactory(SAAJConverterFactory.class);
                SAAJConverter converter = converterFactory.getSAAJConverter();

                // Create a block for each element
                OMBlockFactory bf =
                        (OMBlockFactory)FactoryRegistry.getFactory(OMBlockFactory.class);
                ArrayList<Block> list = new ArrayList<Block>();
                Iterator it = detail.getDetailEntries();
                while (it.hasNext()) {
                    DetailEntry de = (DetailEntry)it.next();
                    OMElement om = converter.toOM(de);
                    Block b = bf.createFrom(om, null, om.getQName());
                    list.add(b);
View Full Code Here

Examples of javax.xml.soap.Detail

        soapFault.setFaultString(reasonText, locale);

        // Set the Detail and contents of Detail
        Block[] blocks = xmlFault.getDetailBlocks();
        if (blocks != null && blocks.length > 0) {
            Detail detail = soapFault.addDetail();
            // Get a OM->SAAJ converter
            SAAJConverterFactory converterFactory =
                    (SAAJConverterFactory)FactoryRegistry.getFactory(SAAJConverterFactory.class);
            SAAJConverter converter = converterFactory.getSAAJConverter();
            for (int i = 0; i < blocks.length; i++) {
View Full Code Here

Examples of javax.xml.soap.Detail

                    soapFault.setFaultActor(fault.getRole());
                }
                if (fault.getDetail() != null
                    && fault.getDetail().getFirstChild() != null) {
                   
                    Detail detail = null;
                    Node child = fault.getDetail().getFirstChild();
                    while (child != null) {
                        if (Node.ELEMENT_NODE == child.getNodeType()) {
                            if (detail == null) {
                                detail = soapFault.addDetail();
                            }
                            Node importedChild = soapMessage.getSOAPPart().importNode(child, true);
                            detail.appendChild(importedChild);
                        }
                        child = child.getNextSibling();
                    }
                }
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.