There is a way to associate a MessageBuilder to a URL. AFAIK this
functionality was implemented for the Nhttp transport. I can't remember the
exact details. But this may be a cleaner approach.

Thanks,
Supun..

On Thu, Jul 19, 2012 at 4:52 AM, Sagara Gunathunga <[email protected]> wrote:

>
>
> On Thu, Jul 19, 2012 at 2:06 PM, Hiranya Jayathilaka <[email protected]>wrote:
>
>> This solution will take care of the message parsing issue. But the main
>> problem is Synapse and Axis2 both associating text/xml with SOAP 1.1.
>> There's a lot of code written based on this assumption. For instance the
>> parsing issue can be worked around by using something like the message
>> relay (we do this in API Manager). But still there are certain things that
>> don't work properly when you send a POX payload with the text/xml content
>> type. For an example, in API Manager if you send a POX message with the
>> text/xml, the query parameters on the URL do not get passed to the backend
>> server, whereas they will get passed if we use application/xml instead.
>>
>> This is a very tricky problem to solve. I tried to solve this for API
>> Manager, but had to give it up considering the time constraints and the
>> possible stability issues it might introduce. We need to discuss this with
>> a larger audience before we decide on the final plan.
>>
>
>   +1 this is the main reason to postponed this issue in Axis2 side too,
> Axis2 lived with this issue for many years and need to study impact with
> large audience first.
>
> Thanks !
>
>>
>> I also just noticed the other mail from Sagara, which explains a proper
>> solution to this issue from Axis2 end. We need incorporate the same fix
>> into Synapse where ever we are looking at the content type to differentiate
>> between SOAP and REST.
>>
>> Thanks,
>> Hiranya
>>
>> On Thu, Jul 19, 2012 at 1:22 PM, Dushan Abeyruwan <[email protected]>wrote:
>>
>>> Hi,
>>>      Recently we had a few issues [1][2] when invoking REST services via
>>> ESB REST API when client sends information with the content type TEXT/XML
>>> (and if BACK END accepts TEXT/XML) so when message receives to ESB if the
>>> content type is defined TEXT/XML by default it will try to build up SOAP
>>> envelope, but AFAIK most REST calls are based
>>> on TEXT/XML so theoretically this kind of messages should be able to handle
>>> via ESB, so for this as solution I have written a Builder formatter,
>>> basically I named this as HYBRID message builder /formatter, the idea is
>>> when  client sends simple xml element with via REST (with content type
>>> TEXT/XML) , the logic is first the hybrid builder checks if the message
>>> content type defines as TEXT/XML followed by root element containing any
>>> SOAP element. if not  Hybrid builder invokes the Application XML builder
>>> internally and will build the message and setting up a flag to message
>>> context thus during the HybridFormatter invocation we can determine that
>>> the original client request content type and write it to the output pipe,
>>>
>>> (did few mock testings with few use cases and worked well)
>>>
>>> any suggestions on this
>>>
>>> [1] https://wso2.org/jira/browse/ESBJAVA-1160
>>> [2]https://wso2.org/jira/browse/ESBJAVA-1160
>>>
>>> cheers,
>>> Dushan Abeyruwan
>>> *Senior Software Engineer*
>>> *Integration Technologies Team*
>>> *WSO2 Inc. http://wso2.com/*
>>> *Mobile:(+94)714408632*
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Hiranya Jayathilaka
>> Senior Technical Lead;
>> WSO2 Inc.;  http://wso2.org
>> E-mail: [email protected];  Mobile: +94 77 633 3491
>> Blog: http://techfeast-hiranya.blogspot.com
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Sagara Gunathunga
>
> Technical Lead; WSO2, Inc.;  http://wso2.com
> V.P Apache Web Services ;  http://ws.apache.org/
> Blog ;  http://ssagara.blogspot.com
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Supun Kamburugamuva
Member, Apache Software Foundation; http://www.apache.org
E-mail: [email protected] <[email protected]>;  Mobile: +94 77 431 3585
Blog: http://supunk.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to