Package javax.xml.soap

Examples of javax.xml.soap.Detail


        SOAPFault fault = msg.getSOAPBody().getFault();
        assertNotNull(fault);
        assertTrue(fault.hasChildNodes());
       
        //For Celtix Runtime Exceptions - SOAPFault will not have a Detail Node
        Detail detail = fault.getDetail();
        if (detail != null) {
            assertFalse("Detail should be non-existent or empty", detail.hasChildNodes());
        }
    }
View Full Code Here


        StringBuffer str = new StringBuffer(clazz.getName());
        str.append(": ");
        str.append(faultString);
        assertEquals(str.toString(), fault.getFaultString());
        assertTrue(fault.hasChildNodes());
        Detail detail = fault.getDetail();
        assertNotNull(detail);
       
        NodeList list = detail.getChildNodes();
        assertEquals(1, list.getLength());
       
        WebFault wfAnnotation = clazz.getAnnotation(WebFault.class);
        assertNotNull(wfAnnotation);
        assertEquals(wfAnnotation.targetNamespace(), list.item(0).getNamespaceURI());
View Full Code Here

        assertNotNull(fault);
        assertEquals(
                     getExceptionString(ex, exMessage),
                     fault.getFaultString());
        assertTrue(fault.hasChildNodes());
        Detail detail = fault.getDetail();
        assertNotNull(detail);
       
        NodeList list = detail.getChildNodes();
        assertEquals(1, list.getLength());
       
        WebFault wfAnnotation = ex.getClass().getAnnotation(WebFault.class);
        assertEquals(wfAnnotation.targetNamespace(), list.item(0).getNamespaceURI());
        assertEquals(wfAnnotation.name(), list.item(0).getLocalName());
View Full Code Here

      if (e instanceof DispositionReportFaultMessage) {
        DispositionReportFaultMessage faultMsg = (DispositionReportFaultMessage) e;
        report = faultMsg.getFaultInfo();
      } else if (e instanceof SOAPFaultException) {
        SOAPFaultException soapFault = (SOAPFaultException) e;
        Detail detail = soapFault.getFault().getDetail();
        if (detail.getFirstChild()!=null) {
          try {
            report =  new DispositionReport(detail.getFirstChild());
          } catch (JAXBException je) {
            log.error("Could not unmarshall detail to a DispositionReport");
          }
        }
      } else if (e instanceof UndeclaredThrowableException) {
View Full Code Here

            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

        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

        return getSaajElement();
    }

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

    }

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

                    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

                    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

Related Classes of javax.xml.soap.Detail

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.