Re: [Dev] ESB is not handling the invalid response type

2016-06-22 Thread Hariprasath Thanarajah
Hi All,

I got the same error when I try with billiving connector create client
operation. You can find the wire log[1]

[1]

[2016-06-22 15:35:02,794]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,794] DEBUG - wire << "Action: urn:createClient[\r][\n]"
[2016-06-22 15:35:02,794]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,794] DEBUG - wire << "Accept-Charset: UTF-8[\r][\n]"
[2016-06-22 15:35:02,794]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,794] DEBUG - wire << "Content-Type: application/json;
charset=UTF-8[\r][\n]"
[2016-06-22 15:35:02,794]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,794] DEBUG - wire << "Accept: text/html, image/gif,
image/jpeg, *; q=.2, */*; q=.2[\r][\n]"
[2016-06-22 15:35:02,794]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,794] DEBUG - wire << "Content-Length: 26[\r][\n]"
[2016-06-22 15:35:02,794]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,794] DEBUG - wire << "Host: www.billiving.com:443
[\r][\n]"
[2016-06-22 15:35:02,794]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,794] DEBUG - wire << "Connection: Keep-Alive[\r][\n]"
[2016-06-22 15:35:02,794]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,794] DEBUG - wire << "User-Agent:
Synapse-PT-HttpComponents-NIO[\r][\n]"
[2016-06-22 15:35:02,795]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,795] DEBUG - wire << "[\r][\n]"
[2016-06-22 15:35:02,795]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:02,795] DEBUG - wire << "{"Email":"1...@gmail.com"}"
[2016-06-22 15:35:03,476]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,476] DEBUG - wire >> "HTTP/1.1 400 Bad Request[\r][\n]"
[2016-06-22 15:35:03,476]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,476] DEBUG - wire >> "Cache-Control: no-cache[\r][\n]"
[2016-06-22 15:35:03,476]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,476] DEBUG - wire >> "Pragma: no-cache[\r][\n]"
[2016-06-22 15:35:03,476]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,476] DEBUG - wire >> "Content-Length: 110[\r][\n]"
[2016-06-22 15:35:03,476]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,476] DEBUG - wire >> "Content-Type: application/json;
charset=utf-8[\r][\n]"
[2016-06-22 15:35:03,477]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,476] DEBUG - wire >> "Expires: -1[\r][\n]"
[2016-06-22 15:35:03,477]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,477] DEBUG - wire >> "Server:
Microsoft-IIS/8.0[\r][\n]"
[2016-06-22 15:35:03,477]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,477] DEBUG - wire >> "X-AspNet-Version:
4.0.30319[\r][\n]"
[2016-06-22 15:35:03,477]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,477] DEBUG - wire >> "X-Powered-By: ASP.NET[\r][\n]"
[2016-06-22 15:35:03,477]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,477] DEBUG - wire >> "Set-Cookie:
ARRAffinity=87810450b90c9a83023a6768742c17e54dbf87a7a858516e54cad2c06cbddacf;Path=/;Domain=www.billiving.com:443
[\r][\n]"
[2016-06-22 15:35:03,477]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,477] DEBUG - wire >> "Date: Wed, 22 Jun 2016 10:05:02
GMT[\r][\n]"
[2016-06-22 15:35:03,477]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,477] DEBUG - wire >> "[\r][\n]"
[2016-06-22 15:35:03,477]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,477] DEBUG - wire >> "*"Your current plan is limited
to 5 clients. Please visit our account upgrade page to explore available
plans."*"
[2016-06-22 15:35:03,485]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,485] *ERROR - JsonUtil #newJsonPayload. Could not save
JSON payload. Invalid input stream found.* MessageID:
urn:uuid:687c4ba7-71e0-4ce8-8600-d2f474509ae4
[2016-06-22 15:35:03,488]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
[2016-06-22 15:35:03,487] ERROR - DeferredMessageBuilder Error building
message
[2016-06-22 15:35:03,488]  INFO

[Dev] ESB is not handling the invalid response type

2016-06-22 Thread Shakila Sivagnanarajah
Hi,

ESB is not handling the string response If the Content-Type is
application/json. Apparently this is the fault on API response. Please find
the wire log [1]. How can we handle this?

[1] - [2016-06-21 16:13:53,915]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:53,915] DEBUG - wire << "GET
/devices/smoke_co_alarms/VhVmm7HOhEcL5sSzblcDOMMSoJ03t2br/co_alarm_state?auth=c.fRDyCBmlbBmwvpmODrw7qMIuJkbwZAtROf53kM9cwHDPEYdasapWaV284w4GnSohzgMuzJM8HEt9Bex3ommjCCoKaFuXFxAX9ZMyb5ckwNDpYWAMepcvbTtm37PRy3vFvARFYhWxOAgvFEEh
HTTP/1.1[\r][\n]"
[2016-06-21 16:13:53,915]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:53,915] DEBUG - wire << "Accept-Charset: UTF-8[\r][\n]"
[2016-06-21 16:13:53,915]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:53,915] DEBUG - wire << "Content-Type:
application/json[\r][\n]"
[2016-06-21 16:13:53,915]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:53,915] DEBUG - wire << "Accept: text/html, image/gif,
image/jpeg, *; q=.2, */*; q=.2[\r][\n]"
[2016-06-21 16:13:53,915]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:53,915] DEBUG - wire << "Host:
firebase-apiserver10-tah01-iad01.dapi.production.nest.com:9553[\r][\n]"
[2016-06-21 16:13:53,916]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:53,915] DEBUG - wire << "Connection: Keep-Alive[\r][\n]"
[2016-06-21 16:13:53,916]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:53,916] DEBUG - wire << "User-Agent:
Synapse-PT-HttpComponents-NIO[\r][\n]"
[2016-06-21 16:13:53,916]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:53,916] DEBUG - wire << "[\r][\n]"
[2016-06-21 16:13:54,237]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,237] DEBUG - wire >> "HTTP/1.1 200 OK[\r][\n]"
[2016-06-21 16:13:54,237]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,237] DEBUG - wire >> "*Content-Type:
application/json; charset=UTF-8*[\r][\n]"
[2016-06-21 16:13:54,237]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,237] DEBUG - wire >> "Access-Control-Allow-Origin:
*[\r][\n]"
[2016-06-21 16:13:54,238]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,237] DEBUG - wire >> "Cache-Control: private,
no-cache, max-age=0[\r][\n]"
[2016-06-21 16:13:54,238]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,238] DEBUG - wire >> "Connection: close[\r][\n]"
[2016-06-21 16:13:54,238]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,238] DEBUG - wire >> "Content-Length: 4[\r][\n]"
[2016-06-21 16:13:54,238]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,238] DEBUG - wire >> "[\r][\n]"
[2016-06-21 16:13:54,238]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,238] DEBUG - wire >> "*"ok"*"
[2016-06-21 16:13:54,241]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,241] ERROR - JsonUtil #newJsonPayload. *Could not
save JSON payload. Invalid input stream found.* MessageID:
urn:uuid:84033421-f5c1-47a3-a3c7-9764c6cd087d
[2016-06-21 16:13:54,242]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 [2016-06-21 16:13:54,241] ERROR - DeferredMessageBuilder Error building
message
[2016-06-21 16:13:54,242]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
 org.apache.axis2.AxisFault: No JSON payload provided.
[2016-06-21 16:13:54,242]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -   at
org.apache.synapse.commons.json.JsonStreamBuilder.processDocument(JsonStreamBuilder.java:52)
[2016-06-21 16:13:54,242]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -   at
org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:138)
[2016-06-21 16:13:54,242]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -   at
org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:133)
[2016-06-21 16:13:54,242]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -   at
org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:98)
[2016-06-21 16:13:54,243]  INFO
{org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -   at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:72)
[2016-06-21