Hi Nirodha,

I just tried your scenario with latest ESB 5.0.0 and it works fine for me.
With message type property[1] and "Accept" header[2], we can control what
"Content-Type" header and "Accept" header goes to the back end even when
the proxy service get invoked by a schedule task.

Can you specify the ESB version you are using and can you attach the proxy
service and schedule task you used?

[1] - <property name="messageType" value="text/html" scope="axis2"
type="STRING"/>
[2] - <header name="Accept" scope="transport" value="text/html"/>

Thanks,

On 27 August 2016 at 21:40, Nirodha Gallage <[email protected]> wrote:

> Hi Rajith,
>
> It is already there and worked when calling with SOAP client. But not
> working with the task.
>
> Thanks,
>
> On Sat, Aug 27, 2016 at 7:54 PM, Rajith Vitharana <[email protected]>
> wrote:
>
>> Hi Nirodha,
>>
>> Try setting "messageType" property before calling the Rest backend,
>> sample would be [1]
>>
>> [1] - <property name="messageType" value="text/plain" scope="axis2"/>
>>
>> Thanks,
>>
>> On 27 August 2016 at 19:41, Nirodha Gallage <[email protected]> wrote:
>>
>>> 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
>>>
>>>
>>
>>
>> --
>> Rajith Vitharana
>>
>> Senior Software Engineer,
>> WSO2 Inc. : wso2.com
>> Mobile : +94715883223
>> Blog : http://lankavitharana.blogspot.com/
>> <http://wso2.com/signature>
>>
>
>
>
> --
>
> *Nirodha Gallage*
> Associate Technical Lead
> WSO2 Inc.: http://wso2.com/
> Mobile: +94716429078
>



-- 
Rajith Vitharana

Senior Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94715883223
Blog : http://lankavitharana.blogspot.com/
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to