Hi,

I'm have created a proxy service which calls a REST endpoint which sends a
text response. Before calling the endpoint I have set the below headers to
get the response as text/plain. And then I read values from response using
xpath function.

​<property name="messageType" value="text/plain" scope="axis2"/>​
​<header name="Accept" scope="transport" value="text/plain"/>​

The whole scenario works fine when you call the proxy service with a SOAP
client. But when the proxy is invoked with a scheduled task it does not
work and gives a message builder error. While debugging it I figured out
that 'Content-Type' header is not set in the second scenario(task) in the
rest service call, due to that it is sending text/html response. Is this a
known issue? Is there any solution for this.

I also tried with setting following two header/property but that also did
not work.

<header name="Content-Type" scope="transport" value="text/plain"
action="set" />
 <property name="ContentType" value="text/plain" scope="axis2" action="set"
/>

Thanks,
Nirodha

-- 

*Nirodha Gallage*
Associate Technical Lead
WSO2 Inc.: http://wso2.com/
Mobile: +94716429078
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to