Examples of Detail


Examples of javax.xml.soap.Detail

//                ServiceRuntimeException e = responseMsg.getBody();
//                throw e;

                FaultException fe = responseMsg.getBody();
                SOAPFault fault = response.getSOAPBody().addFault(new QName(response.getSOAPBody().getNamespaceURI(), "Server"), fe.getMessage());
                Detail d = fault.addDetail();
                DetailEntry de = d.addDetailEntry(fe.getFaultName());
                SOAPElement dece = de.addChildElement("message");
                if (fe.getMessage() != null) {
                    dece.addTextNode(fe.getMessage());
                }
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

    private void validateFault(SoapMessage message, SOAPFault fault, BindingOperationInfo bop) {
        if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.OUT, message)) {
            Schema schema = EndpointReferenceUtils.getSchema(message.getExchange().getService()
                                                             .getServiceInfos().get(0),
                                                         message.getExchange().getBus());
            Detail d = fault.getDetail();
            try {
                validateFaultDetail(d, schema, bop);
            } catch (Exception e) {
                throw new SoapFault(e.getMessage(), e, message.getVersion().getReceiver());
            }
View Full Code Here

Examples of javax.xml.soap.Detail

    */
    public void testAddDetailEntry() throws Exception {
        //Add a SOAPFault object to the SOAPBody
        SOAPFault sf = body.addFault();
        //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

Examples of javax.xml.soap.Detail

        body = envelope.getBody();

        //Add a SOAPFault object to the SOAPBody
        SOAPFault sf = body.addFault();
        //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

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.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);
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

            SOAPBody body = m.getSOAPBody();
            SOAPFault fault = body.addFault();
            QName faultCode = new QName(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE, "Client");
            fault.setFaultCode(faultCode);
            fault.setFaultString("sample fault");
            Detail detail = fault.addDetail();
            Name deName = sf.createName("detailEntry");
            SOAPElement detailEntry = detail.addDetailEntry(deName);
            detailEntry.addTextNode("sample detail");
            fault.setFaultActor("sample actor");
           
            SOAPFaultException sfe = new SOAPFaultException(fault);
            throw sfe;
View Full Code Here

Examples of javax.xml.soap.Detail

        try {
            SOAPFactory sf = SOAPFactory.newInstance();
            if (sf == null) {
                fail("SOAPFactory was null");
            }
            Detail d = sf.createDetail();
            if (d == null) {
                fail("Detail was null");
            }
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

Examples of javax.xml.soap.Detail

    {
        AxisFault axisFault =
                new AxisFault( soapfe.getFaultCode(),
                        soapfe.getFaultString(),
                        soapfe.getFaultActor(), null );
        Detail detail = soapfe.getDetail();
        Iterator detailEntryIter = detail.getDetailEntries();
        while ( detailEntryIter.hasNext() )
        {
            DetailEntry detailEntry = (DetailEntry) detailEntryIter.next();
            axisFault.addFaultDetail( detailEntry );
        }
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.