Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.3.6
-
None
-
None
Description
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 is caused by extract text content directly from partValue but probably should be done for the first child:
org.apache.ode.axis2.httpbinding.HttpMethodConverter
... } 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)); // <--should be like here 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); // <--get content directly } ...
Attached example with operation name="Hello"