Example usage for javax.xml.soap SOAPException getMessage

List of usage examples for javax.xml.soap SOAPException getMessage

Introduction

In this page you can find the example usage for javax.xml.soap SOAPException getMessage.

Prototype

@Override
public String getMessage() 

Source Link

Document

Returns the detail message for this SOAPException object.

Usage

From source file:org.jlibrary.core.repository.axis.AxisRepositoryService.java

/**
 * @see org.jlibrary.core.repository.def.ResourcesModule#updateResourceNode(org.jlibrary.core.entities.Ticket, org.jlibrary.core.properties.ResourceNodeProperties)
 *//*from  w  ww  .  j  a va 2s  .  c  o  m*/
public ResourceNode updateResourceNode(Ticket ticket, ResourceNodeProperties properties)
        throws RepositoryException, SecurityException {
    org.jlibrary.core.repository.RepositoryService service = JLibraryServiceFactory.getInstance(localProfile)
            .getRepositoryService();

    if (properties.hasProperty(ResourceNodeProperties.RESOURCE_CONTENT)) {
        byte[] realContent;
        try {
            AttachmentPart[] attachments = getMessageAttachements();
            InputStream is = attachments[0].getDataHandler().getInputStream();
            realContent = IOUtils.toByteArray(is);
            is.close();
            properties.setProperty(ResourceNodeProperties.RESOURCE_CONTENT, realContent);
        } catch (AxisFault e) {
            logger.error(e.getMessage(), e);
            throw new RepositoryException(e);
        } catch (IOException ioe) {
            logger.error(ioe.getMessage(), ioe);
            throw new RepositoryException(ioe);
        } catch (SOAPException se) {
            logger.error(se.getMessage(), se);
            throw new RepositoryException(se);
        } catch (PropertyNotFoundException e) {
            logger.error(e.getMessage(), e);
            throw new RepositoryException(e);
        } catch (InvalidPropertyTypeException e) {
            logger.error(e.getMessage(), e);
            throw new RepositoryException(e);
        }
    }

    return service.updateResourceNode(ticket, properties);
}

From source file:org.sdm.spa.WSWithComplexTypes.java

/**
 * Create and send the request, and send the response to the appropriate
 * output ports./*w  ww. ja va 2 s. co m*/
 */
public void fire() throws IllegalActionException {
    super.fire();

    wsdl.update();
    //System.out.println(getName());

    SOAPBodyElement sbe;
    try {
        sbe = _buildSOAPBodyRoot();
    } catch (SOAPException e) {
        throw new IllegalActionException(this, e, "Error build SOAP request.");
    }

    List<?> response = null;
    boolean ignoringError = false;

    try {
        //System.out.println(getFullName() + " invoking");
        response = _invokeMethod(sbe);
        //System.out.println(getFullName() + " done");
    } catch (Exception e) {
        boolean ignoreInvokeErrorsVal = ((BooleanToken) ignoreInvokeErrors.getToken()).booleanValue();
        if (!ignoreInvokeErrorsVal) {
            throw new IllegalActionException(this, e, "Error invoking service.");
        } else {
            System.out.println("WARNING: Ignoring invocation error: " + e.getMessage());
            ignoringError = true;
        }
    }

    if (!ignoringError) {
        _parseResponse(response);
        hadError.broadcast(BooleanToken.FALSE);
    } else {
        hadError.broadcast(BooleanToken.TRUE);
    }

}

From source file:org.springframework.ws.soap.saaj.SaajSoapMessageFactory.java

public SaajSoapMessage createWebServiceMessage() {
    try {/*  w  w  w . ja v a2  s .  c om*/
        SOAPMessage saajMessage = messageFactory.createMessage();
        postProcess(saajMessage);
        return new SaajSoapMessage(saajMessage, langAttributeOnSoap11FaultString, messageFactory);
    } catch (SOAPException ex) {
        throw new SoapMessageCreationException("Could not create empty message: " + ex.getMessage(), ex);
    }
}

From source file:org.springframework.ws.soap.saaj.SaajSoapMessageFactory.java

public SaajSoapMessage createWebServiceMessage(InputStream inputStream) throws IOException {
    MimeHeaders mimeHeaders = parseMimeHeaders(inputStream);
    try {//from  ww w. jav  a2  s.com
        inputStream = checkForUtf8ByteOrderMark(inputStream);
        SOAPMessage saajMessage = messageFactory.createMessage(mimeHeaders, inputStream);
        postProcess(saajMessage);
        return new SaajSoapMessage(saajMessage, langAttributeOnSoap11FaultString, messageFactory);
    } catch (SOAPException ex) {
        // SAAJ 1.3 RI has a issue with handling multipart XOP content types which contain "startinfo" rather than
        // "start-info", so let's try and do something about it
        String contentType = StringUtils
                .arrayToCommaDelimitedString(mimeHeaders.getHeader(TransportConstants.HEADER_CONTENT_TYPE));
        if (contentType.contains("startinfo")) {
            contentType = contentType.replace("startinfo", "start-info");
            mimeHeaders.setHeader(TransportConstants.HEADER_CONTENT_TYPE, contentType);
            try {
                SOAPMessage saajMessage = messageFactory.createMessage(mimeHeaders, inputStream);
                postProcess(saajMessage);
                return new SaajSoapMessage(saajMessage, langAttributeOnSoap11FaultString);
            } catch (SOAPException e) {
                // fall-through
            }
        }
        throw new SoapMessageCreationException("Could not create message from InputStream: " + ex.getMessage(),
                ex);
    } catch (SaajSoapEnvelopeException ex) {
        SAXParseException parseException = getSAXParseException(ex);
        if (parseException != null) {
            throw new InvalidXmlException("Could not parse XML", parseException);
        } else {
            throw ex;
        }
    }
}