Example usage for javax.xml.soap SOAPFault getTextContent

List of usage examples for javax.xml.soap SOAPFault getTextContent

Introduction

In this page you can find the example usage for javax.xml.soap SOAPFault getTextContent.

Prototype

public String getTextContent() throws DOMException;

Source Link

Document

This attribute returns the text content of this node and its descendants.

Usage

From source file:de.extra.extraClientLight.util.SendWebService.java

/**
 * /*from  ww  w .  ja  va  2  s . c o m*/
 * @param extraRequest
 * @param url
 * @param mtomActive
 * @return
 */
public TransportResponseType sendRequest(TransportRequestType extraRequest, String url, boolean mtomActive) {
    TransportResponseType response = new TransportResponseType();

    Extra_Service extraService = new Extra_Service(null, SERVICE_NAME);

    Extra extraPort = extraService.getPort(Extra.class);
    BindingProvider bp = (BindingProvider) extraPort;
    bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);

    SOAPBinding soapBinding = (SOAPBinding) bp.getBinding();
    soapBinding.setMTOMEnabled(mtomActive);

    try {
        LOGGER.debug("Versand gestartet...");
        response = extraPort.execute(extraRequest);
        LOGGER.debug("...Empfang Response");

        if (mtomActive) {
            Collection<Attachment> attachmentList = (Collection<Attachment>) bp.getResponseContext()
                    .get(Message.ATTACHMENTS);

            LOGGER.debug("Attachments: " + attachmentList.size());

        }
    } catch (SOAPFaultException e) {
        SOAPFault soapFault = e.getFault();

        LOGGER.error(soapFault.getTextContent(), e);

    } catch (ExtraFault e) {
        ExtraErrorHelper.printExtraError(e);
    }

    return response;

}

From source file:org.apache.juddi.api.impl.API_141_JIRATest.java

static void HandleException(Exception ex) {
    System.err.println("Error caught of type " + ex.getClass().getCanonicalName());
    ex.printStackTrace();//  w w  w  .  j  a v a  2 s  .  co  m
    if (ex.getMessage() != null) {
        Assert.assertFalse(ex.getMessage().contains(TRANS));
        Assert.assertFalse(ex.getMessage().contains(MISSING_RESOURCE));
    }
    if (ex instanceof SOAPFault) {
        SOAPFault sf = (SOAPFault) ex;
        if (!sf.getTextContent().contains("org.apache.juddi.v3.error.ValueNotAllowedException")) {
            Assert.fail();
        }
    }
}

From source file:org.apache.juddi.v3.tck.UDDI_140_NegativePublicationIntegrationTest.java

static void HandleException(Exception ex) {
    if (logger.isDebugEnabled()) {
        System.err.println("Error caught of type " + ex.getClass().getCanonicalName());
        ex.printStackTrace();/*from   ww w .j a  va  2  s .c om*/
    }
    Assert.assertFalse(ex.getMessage().contains(TRANS));
    Assert.assertFalse(ex.getMessage().contains(MISSING_RESOURCE));
    if (ex instanceof SOAPFault) {
        SOAPFault sf = (SOAPFault) ex;
        if (!sf.getTextContent().contains("org.apache.juddi.v3.error.ValueNotAllowedException")) {
            Assert.fail();
        }
    }
}