Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFaultDetail


       
        SOAPFaultReason soapFaultReason = factory.createSOAPFaultReason();
        soapFaultReason.setText(faultReason);
        soapFault.setReason(soapFaultReason);
       
        SOAPFaultDetail soapFaultDetail = factory.createSOAPFaultDetail();
        soapFaultDetail.setText(faultDetail);
        soapFault.setDetail(soapFaultDetail);
       
        msgContext.setEnvelope(faultEnvelope);
    }
View Full Code Here


        setNewElement(getDetail(), detail);
    }

    /** If exception detailElement is not there we will return null */
    public Exception getException() throws OMException {
        SOAPFaultDetail detail = getDetail();
        if (detail == null) {
            return null;
        }

        OMElement exceptionElement = getDetail().getFirstChildWithName(
View Full Code Here

    protected void putExceptionToSOAPFault(Exception e) throws SOAPProcessingException {
        StringWriter sw = new StringWriter();
        e.printStackTrace(new PrintWriter(sw));
        sw.flush();
        SOAPFaultDetail detail = getDetail();
        if (detail == null) {
            detail = getNewSOAPFaultDetail(this);
            setDetail(detail);
        }
        OMElement faultDetailEnty = new OMElementImpl(detail,
View Full Code Here

        SOAPFaultRole faultRole = getRole();
        if (faultRole != null && faultRole.getText() != null && !"".equals(faultRole.getText())) {
            ((OMNodeEx) faultRole).internalSerialize(writer, true);
        }

        SOAPFaultDetail faultDetail = getDetail();
        if (faultDetail != null) {
            ((OMNodeEx) faultDetail).internalSerialize(writer, true);
        }

        OMSerializerUtil.serializeEndpart(writer);
View Full Code Here

        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault fault = soapFactory.createSOAPFault();
        SOAPFaultDetail detail = soapFactory.createSOAPFaultDetail(fault);
        OMElement detailEntry = soapFactory.createOMElement(new QName(SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY));
        detailEntry.setText("This is an exception message");
        detail.addDetailEntry(detailEntry);
        Exception exception = fault.getException();
        assertNotNull(exception);
        assertEquals("This is an exception message", exception.getMessage());
    }
View Full Code Here

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        SOAPFault fault = soapFactory.createSOAPFault(body);
        SOAPFaultDetail soapFaultDetail = soapFactory.createSOAPFaultDetail(fault);
        OMNamespace omNamespace = soapFactory.createOMNamespace("http://www.test.org", "test");
        Iterator iterator = soapFaultDetail.getAllDetailEntries();
        assertFalse(
                "SOAP Fault Detail Test : - After creating SOAP11FaultDetail element, it has DetailEntries",
                iterator.hasNext());
        soapFaultDetail.addDetailEntry(
                soapFactory.createOMElement("DetailEntry", omNamespace));
        iterator = soapFaultDetail.getAllDetailEntries();
        OMElement detailEntry = (OMElement) iterator.next();
        assertNotNull(
                "SOAP Fault Detail Test : - After calling addDetailEntry method, getAllDetailEntries method returns empty iterator",
                detailEntry);
        assertEquals(
View Full Code Here

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        SOAPFault fault = soapFactory.createSOAPFault(body);
        SOAPFaultDetail soapFaultDetail = soapFactory.createSOAPFaultDetail(fault);
        OMNamespace omNamespace = soapFactory.createOMNamespace("http://www.test.org", "test");
        soapFaultDetail.addDetailEntry(
                soapFactory.createOMElement("DetailEntry1", omNamespace));
        soapFaultDetail.addDetailEntry(
                soapFactory.createOMElement("DetailEntry2", omNamespace));
        Iterator iterator = soapFaultDetail.getAllDetailEntries();
        OMElement detailEntry1 = (OMElement) iterator.next();
        assertNotNull(
                "SOAP Fault Detail Test : - After calling addDetailEntry method twice, getAllDetailEntries method returns empty iterator",
                detailEntry1);
        assertEquals(
View Full Code Here

    public TestGetAllDetailEntriesWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFaultDetail soapFaultDetail = getTestMessage(MESSAGE).getBody().getFault().getDetail();
        Iterator iterator = soapFaultDetail.getAllDetailEntries();
        OMText textEntry = (OMText) iterator.next();
        assertNotNull(
                "SOAP Fault Detail Test With Parser : - getAllDetailEntries method returns empty iterator",
                textEntry);
        assertEquals(
View Full Code Here

    public TestDetailEntriesUsingDefaultNamespaceWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFaultDetail soapFaultDetail = getTestMessage("fault-detail-default-namespace.xml").getBody().getFault().getDetail();
        OMElement detailElement = soapFaultDetail.getFirstElement();
        assertEquals("AddNumbersHandlerFault", detailElement.getLocalName());
        OMNamespace ns = detailElement.getNamespace();
        // At some point, there was a bug in Axiom that caused the prefix to be null
        assertEquals("", ns.getPrefix());
        assertEquals("http://www.example.org/addnumbershandler", ns.getNamespaceURI());
View Full Code Here

    public TestWSCommons202(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFaultDetail soapFaultDetail = soapFactory.createSOAPFaultDetail();
        soapFaultDetail.setText("a");

        assertTrue(soapFaultDetail.getText().trim().equals("a"));
        assertTrue("Text serialization has problems. It had serialized same text twice", soapFaultDetail.toString().indexOf("aa") == -1);

        OMElement omElement = soapFactory.createOMElement("DummyElement", null);
        soapFaultDetail.addChild(omElement);
        omElement.setText("Some text is here");

        assertTrue("Children of SOAP Fault Detail element are not serialized properly", soapFaultDetail.toString().indexOf("Some text is here") != -1);
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.SOAPFaultDetail

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.