On Thu, May 29, 2014 at 6:01 PM, Shameera Rathnayaka <[email protected]>wrote:

> Hi Charitha/Anjana,
>
>  Shameera any idea on why this would be happening? .. is it something
>> that should be done explicitly in the message formatter which we are not
>> doing? ..
>>
>
> ​No, Formatter is not responsible for setting content type of message it
> only serialize message body to outputStream. Anjana could you please check,
> what is different of using above two Formatters​, I doubt that we
> explicitly handle this content type for old json formatter.
>

I see, sure, will check it out.

Cheers,
Anjana.


>
> FYI: I am on Study leave.
>
> ​Thanks,
> Shameera.
>
>
>
>> @Charitha, we cannot simply tell users to just switch to the other JSON
>> formatter because, we lose some features with the old JSON formatter, so
>> even without the content type returned, some users may not have an issue
>> with it, so I don't think we don't have to put an entry to the docs
>> explaining the issue, rather, can you please create an JIRA issue for this
>> to track it, so we can fix it in the next release.
>>
>> Cheers,
>> Anjana.
>>
>>
>> On Wed, May 28, 2014 at 11:01 PM, Charitha Kankanamge 
>> <[email protected]>wrote:
>>
>>> Any update on this? Looks like the latest 
>>> org.apache.axis2.json.gson.JsonFormatter
>>> is broken since the application/json content-type header is not added to
>>> the response.
>>>
>>> Charitha Kankanamge
>>> cell: +1 812-391-7730
>>> http://charithaka.blogspot.com
>>> *SOA and Testing without nonsense*
>>>
>>>
>>> On Wed, May 28, 2014 at 12:51 AM, Charitha Kankanamge <[email protected]
>>> > wrote:
>>>
>>>> Hi Anjana et all,
>>>> DSS uses org.apache.axis2.json.gson.JsonFormatter by default. However,
>>>> when calling a service which responds JSON, the message looks similar to
>>>> the following.
>>>>
>>>> *HTTP/1.1 200 OK*
>>>> *Transfer-Encoding: chunked*
>>>> *Date: Tue, 27 May 2014 19:14:45 GMT*
>>>> *Connection: close*
>>>> *Server: WSO2 Carbon Server*
>>>>
>>>> {"customers":{"customer":[{"phone":"6175559555
>>>> ","contact":{"contact-last-name":"Yoshido","customer-name":"Gifts4AllAges.com","contact-first-name":"Juri"},"city":"Boston"},{"phone":"
>>>> 6175552555","contact":{"contact-last-name":"Franco","customer-name":"Diecast
>>>> Collectables","contact-first-name":"Valarie"},"city":"Boston"}]}}
>>>>
>>>> ​I had to comment out this default formatter and use the 
>>>> org.apache.axis2.json.JSONMessageFormatter.
>>>> Then I got the correct response.
>>>>
>>>> HTTP/1.1 200 OK
>>>> *Content-Type: application/json;charset=UTF-8*
>>>> Transfer-Encoding: chunked
>>>> Date: Tue, 27 May 2014 19:17:02 GMT
>>>> Connection: close
>>>> Server: WSO2 Carbon Server
>>>>
>>>> {"customers":{"customer":[{"phone":"6175559555
>>>> ","contact":{"contact-last-name":"Yoshido","customer-name":"Gifts4AllAges.com","contact-first-name":"Juri"},"city":"Boston"},{"phone":"
>>>> 6175552555","contact":{"contact-last-name":"Franco","customer-name":"Diecast
>>>> Collectables","contact-first-name":"Valarie"},"city":"Boston"}]}}​
>>>>
>>>> ​This can simply be observed by running JSON sample included in a fresh
>>>> pack (DSS-3.2.1). Is this a bug in new formatter? If so, it is better to
>>>> document this and ask to use org.apache.axis2.json.JSONMessageFormatter
>>>> instead.
>>>>
>>>> Thanks!
>>>> Charitha​
>>>>
>>>>
>>>> Charitha Kankanamge
>>>> cell: +1 812-391-7730
>>>> http://charithaka.blogspot.com
>>>> *SOA and Testing without nonsense*
>>>>
>>>
>>>
>>
>>
>> --
>> *Anjana Fernando*
>> Senior Technical Lead
>> WSO2 Inc. | http://wso2.com
>> lean . enterprise . middleware
>>
>
>
>
> --
> *Software Engineer - WSO2 Inc.*
> *email: shameera AT wso2.com <[email protected]> , shameera AT apache.org
> <[email protected]>*
> *phone:  +9471 922 1454 <%2B9471%20922%201454>*
>
> *Linked in : *http://lk.linkedin.com/pub/shameera-rathnayaka/1a/661/561
> *Twitter     : *https://twitter.com/Shameera_R
>



-- 
*Anjana Fernando*
Senior Technical Lead
WSO2 Inc. | http://wso2.com
lean . enterprise . middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to