Package javax.xml.soap

Examples of javax.xml.soap.DetailEntry


        //Add a Detail object to the SOAPFault object
        Detail d = sf.addDetail();
        QName name = new QName("http://www.wombat.org/trader",
                               "GetLastTradePrice", "WOMBAT");
        //Add a DetailEntry object to the Detail object
        DetailEntry de = d.addDetailEntry(name);
        assertNotNull(de);
        assertTrue(de instanceof DetailEntry);
    }
View Full Code Here


        //Add a Detail object to the SOAPFault object
        Detail d = sf.addDetail();
        QName name = new QName("http://www.wombat.org/trader",
                               "GetLastTradePrice", "WOMBAT");
        //Add a DetailEntry object to the Detail object
        DetailEntry de = d.addDetailEntry(name);
        //Successfully created DetailEntry object
        assertNotNull(de);
        assertTrue(de instanceof DetailEntry);
    }
View Full Code Here

        assertTrue(d2 != null);
        Iterator i = d2.getDetailEntries();
        assertTrue(getIteratorCount(i) == 1);
        i = d2.getDetailEntries();
        while (i.hasNext()) {
            DetailEntry de = (DetailEntry)i.next();
            assertEquals(de.getElementName(), name);
        }
    }
View Full Code Here

                OMBlockFactory bf =
                        (OMBlockFactory)FactoryRegistry.getFactory(OMBlockFactory.class);
                ArrayList<Block> list = new ArrayList<Block>();
                Iterator it = detail.getChildElements();
                while (it.hasNext()) {
                    DetailEntry de = (DetailEntry)it.next();
                    OMElement om = converter.toOM(de);
                    Block b = bf.createFrom(om, null, om.getQName());
                    list.add(b);
                }
                blocks = new Block[list.size()];
View Full Code Here

        Detail detail = fault.addDetail();

        QName entryName = new QName("http://gizmos.com/orders/",
                        "order", "PO");
        DetailEntry entry = detail.addDetailEntry(entryName);
        entry.addTextNode("Quantity element does not have a value");

        QName entryName2 = new QName("http://gizmos.com/orders/",
                        "order", "PO");
        DetailEntry entry2 = detail.addDetailEntry(entryName2);
        entry2.addTextNode("Incomplete address: no zip code");

        return new SOAPFaultException(fault);
    }
View Full Code Here

        Detail detail = new Detail(fault);
        Element[] darray = fault.getFaultDetails();
        for (int i = 0; i < darray.length; i++)
        {
            Element detailtEntryElem = darray[i];
            DetailEntry detailEntry = detail.addDetailEntry(
                    new PrefixedQName(detailtEntryElem.getNamespaceURI(),
                            detailtEntryElem.getLocalName(), detailtEntryElem.getPrefix()));
            copyChildren(detailEntry, detailtEntryElem);
        }
        return detail;
View Full Code Here

      
                    Detail detail = soapFault.addDetail();
                    detail = soapFault.getDetail();
      
                    QName qName = new QName("http://www.Hello.org/greeter", "TestFault", "ns");
                    DetailEntry de = detail.addDetailEntry(qName);
      
                    qName = new QName("http://www.Hello.org/greeter", "ErrorCode", "ns");
                    SOAPElement errorElement = de.addChildElement(qName);
                    errorElement.setTextContent("errorcode");
                    throw new SOAPFaultException(soapFault);
                } catch (SOAPException ex) {
                    //ignore
                }
View Full Code Here

    private void setFault(Message msg, SOAPFaultException e) {
        SOAPFault fault = e.getFault();
        Detail detail = fault.getDetail();
        if (detail != null) {
            for (Iterator i = detail.getDetailEntries(); i.hasNext();) {
                DetailEntry entry = (DetailEntry)i.next();
                FaultException fe = new FaultException(e.getMessage(), entry.getFirstChild(), e);
                fe.setFaultName(entry.getElementQName());
                msg.setFaultBody(fe);
            }
        }
    }
View Full Code Here

        SOAPFault fault = body.getFault();
        fault.addDetail();
        javax.xml.soap.Detail d = fault.getDetail();
        Iterator i = d.getDetailEntries();
        while (i.hasNext()) {
            DetailEntry entry = (DetailEntry)i.next();
            String name = entry.getElementName().getLocalName();
            if ("tickerSymbol".equals(name)) {
                assertEquals("the value of the tickerSymbol element didn't match",
                             "MACR", entry.getValue());
            } else if ("exceptionName".equals(name)) {
                assertEquals("the value of the exceptionName element didn't match",
                             "test.wsdl.faults.InvalidTickerFaultMessage", entry.getValue());
            } else {
                assertTrue("Expecting details element name of 'tickerSymbol' or " +
                        "'expceptionName' - I found :" + name, false);
            }
        }
View Full Code Here

        assertEquals("http://gizmos.com/order", fault.getFaultActor());

        //Add Fault Detail information
        Detail faultDetail = fault.addDetail();
        Name cwmpFaultName = envelope.createName("Fault", "cwmp", "http://cwmp.com");
        DetailEntry faultDetailEntry = faultDetail.addDetailEntry(cwmpFaultName);
        SOAPElement e = faultDetailEntry.addChildElement("FaultCode");

        e.addTextNode("This is the fault code");
        SOAPElement e2 = faultDetailEntry.addChildElement(envelope.createName("FaultString",
                                                                              "cwmp",
                                                                              "http://cwmp.com"));
        e2.addTextNode("Fault Message");

        SOAPElement e3 = faultDetailEntry.addChildElement("Message");
        e3.addTextNode("This is a test fault");

        soapMessage.saveChanges();

        // ------------------- Validate the contents -------------------------------------
        final Detail detail = fault.getDetail();
        final Iterator detailEntryIter = detail.getDetailEntries();
        boolean foundFirst = false;
        boolean foundSecond = false;
        boolean foundThird = false;
        while (detailEntryIter.hasNext()) {
            final DetailEntry detailEntry = (DetailEntry)detailEntryIter.next();
            final Iterator childElementsIter = detailEntry.getChildElements();
            while (childElementsIter.hasNext()) {
                final SOAPElement soapElement = (SOAPElement)childElementsIter.next();
                if (soapElement.getTagName().equals("FaultCode") &&
                        soapElement.getValue().equals("This is the fault code")) {
                    foundFirst = true;
View Full Code Here

TOP

Related Classes of javax.xml.soap.DetailEntry

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.