Though your observation is correct here actual issue is not related to MessageBuilders/MessageFormatters instead of not picking correct MessageBuilder/MessageFormatter combination. Axis2 REST guide contains following text
""if the content type is text/xml and if the SOAPAction Header is missing, then the message is treated as a RESTful Message, if not it is treated as a usual SOAP Message." In summery content type - text/xml + SOAPAction present => SOAP 1.1 message content type - text/xml + NO SOAPAction present => Pure XML (REST) In contrast to documentation Axis2 never implemented above logic and always consider text/xml as SOAP 1.1 content that is the root cause for this issue. The solution need to be implemented on Axis2 level by adding one more condition to TransportUtil class. This is already reported by Charitha[1] and postponed, we waited to see any real user effected by this issue since now we have real user issues we can correct the logic in Axis2. AFAIK MessageBuilders/MessageFormatters are specific to a content type and architecturally incorrect to handle more than one content type by single MessageBuilders/MessageFormatters. [1] - https://wso2.org/jira/browse/CARBON-13600 Thanks ! On Thu, Jul 19, 2012 at 1:22 PM, Dushan Abeyruwan <dus...@wso2.com> 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 > Dev@wso2.org > 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 Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev