Hi Chanaka,
On Sun, Mar 30, 2014 at 9:34 AM, Chanaka Fernando <[email protected]> wrote: > Hi All, > > As per the ESB documentation, both messageType and ContentType properties > are used to select the messageFormatter. See the description section of the > properties below. > > messageType > > Message formatter is selected based on this property. This property > should have the content type, such as text/xml, application/xml, or > application/json. > > > ContentType > > This property will be in effect only if the messageType property is set. > If the messageType is set, the value of Content-Type HTTP header of the > outgoing request will be chosen based on this property. Note that, this > will be dependent on the Message Formatter implementation. > > > According to the above description, we are using the ContentType property > to set the Content-Type http header of the outgoing message. But this can > be achieved only through the messageType property itself. For example, In > the JSON documentation, we are using the messageType property to change the > Content-Type of the message from application/xml to application/json. > > > We could find a lot of samples where we use messageType property only for > this Content-Type conversion. With this capability of the messageType > property, do we really need the ContentType property anymore? > Yes. as given in the description, messageType is used to select the MessageFormatter. Most of the message formatters set the Content-Type to it's default Content-Type. But some message formatters has given an extra flexibility to set a different Content-Type using the Content-Type property which is totally depend on the MessageFormatter implementation. > > > Thanks, > Chanaka > > > > -- > -- > Chanaka Fernando > Technical Lead > WSO2, Inc.; http://wso2.com > lean.enterprise.middleware > > mobile: +94 773337238 > Blog : http://soatutorials.blogspot.com > LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0 > Twitter:https://twitter.com/chanakaudaya > Wordpress:http://chanakaudaya.wordpress.com > > > > -- *Isuru Udana* Senior * Software Engineer* WSO2 Inc.; http://wso2.com email: [email protected] cell: +94 77 3791887 blog: http://mytecheye.blogspot.com/ twitter: http://twitter.com/isudana
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
