ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Vorobiov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ODE-1050) Service call fails for http binding with "text/plain" content type
Date Thu, 31 Mar 2016 09:51:25 GMT
Igor Vorobiov created ODE-1050:

             Summary: Service call fails for http binding with "text/plain" content type
                 Key: ODE-1050
                 URL: https://issues.apache.org/jira/browse/ODE-1050
             Project: ODE
          Issue Type: Bug
          Components: Axis2 Integration
    Affects Versions: 1.3.6
            Reporter: Igor Vorobiov

There is problem with service call for http binding with "text/plain" content type. Such call
fails with following exception:
java.lang.IllegalArgumentException: The content cannot be null                           

        at org.apache.commons.httpclient.methods.StringRequestEntity.<init>(StringRequestEntity.java:93)
        at org.apache.ode.axis2.httpbinding.HttpMethodConverter.prepareHttpMethod(HttpMethodConverter.java:214)
It caused by extract text content directly from partValue but should be done for the first
                } else if (HttpUtils.isXml(contentType)) {
                    if (log.isDebugEnabled()) log.debug("Content-Type [" + contentType + "]
equivalent to 'text/xml'");
                    // stringify the first element
                    String xmlString = DOMUtils.domToString(DOMUtils.getFirstChildElement(partValue));
                    requestEntity = new StringRequestEntity(xmlString, contentType, contentCharset);
                } else {
                    if (log.isDebugEnabled())
                        log.debug("Content-Type [" + contentType + "] NOT equivalent to 'text/xml'.
The text content of part value will be sent as text");
                    // encoding conversion is managed by StringRequestEntity if necessary
                    requestEntity = new StringRequestEntity(DOMUtils.getTextContent(partValue),
contentType, contentCharset);

This message was sent by Atlassian JIRA

View raw message