Raw Json data in request in liferay web service - json

I am using liferay 6.2 & i have invoked few web services.The thing is that when passing parameters as form data it works fine, get the json response, but the issue is when pass parameters as raw data json form it gives error "message": "No JSON web service action associated with path /login/user-login and method POST for //xxx-portlet"
This means it doesn't work with Content-Type: application/json. I was trying these things through postman the tool in chrome.I want the my json web service should accept the json raw data in request.

Related

How to enforce "accept" OR " format" parameters in HTTP URL to enforce XML response from server than a JSON

I am always getting JSON response for my HTTP request to access one ORDS-Oracle Rest Data Services API:
http://localhost:8080/ords/hr/employees/
However my requirement is to get XML response. I tried to choose XML from drop down list available at POSTMAN, however content is not changing to XML.
I need a way to specify parameter as part of HTTP URL so that response is XML than JSON and I tried to change URL like below:
Way1:
http://localhost:8080/ords/hr/employees?format=xml
Way2:
http://abcdef.us.oracle.com:8001/claims-ws/api/generic/lineofbusinesses/421?Content-Type:application/xml
Way3:
http://abcdfef.us.oracle.com:8001/claims-ws/api/generic/lineofbusinesses/421?Accept:application/xml
Way4:
http://abcdef.us.oracle.com:8001/claims-ws/api/generic/lineofbusinesses/421?Accept=application/xml
However nothing is working and response is always JSON.
Any suggestion?

Sim808 + Arduino UNO: Get Json Object Response from Web Server

How to read JSON object response from the server?
These are the commands I use:
AT+SAPBR=3,1,"Contype","GPRS"
AT+SAPBR=3,1,"APN","internet"
AT+SAPBR=1,1
AT+SAPBR=2,1
AT+HTTPINIT
AT+HTTPSSL=1
AT+HTTPPARA="CID",1
AT+HTTPPARA="URL","https://www.mywebsite.com/getTime?token=jsdaljdaskl"
AT+HTTPPARA="REDIR",1
AT+HTTPACTION=0
The returning request should be Json object, but the Sim808 read it as html response which gives error 606.
Need to define HTTP parameter content as JSON format using the following command
AT+HTTPPARA="CONTENT","application/json"
Found this document useful HTTP Client using SIM900.

How to read body of HttpRequest POSTed to a REST web service - IBM Integration Bus

I am exposing a Rest based POST API and have to read few parameters in the body along with header. I am able to fetch the query string (header) parameters using HTTP Input node query string parser. As i have configured Input parser to JSON, it can not parse the incoming message and gives a runtime exception :
JSON parsing errors have occurred
Content-Type is set to :
application/x-www-form-urlencoded
I am very newbie with Rest/ JSON services on IIB. Help would be greatly appreciated.

cannot get document id using box view api

In my app, after get "https://dl.boxcloud.com/*" url and send it to the View API, I receive this error:
{
message: "JSON parse error - No JSON object could be decoded"
type: "error"
request_id: "3ef12abcaf7a4c5abab5fb0d3959255e"
}
you can use this chrome extension to recreate this error
https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo
I tried with the other rest clients and it work correctly. Except in my app and the extension above.
I tried with the other rest clients and it work correctly. Except in my app and the extension above.
If this is the case, it's likely that the client you're using isn't actually sending properly formatted JSON. One way to debug this would be to output the raw HTTP request the client is sending and ensuring that it's actually sending the JSON properly.

JSON return format cordys BOP

I'm using Cordys BOP and I have a REST web service that returns JSON format. I have a test service that I use, that returns XML and this works fine so I know that my HTTP connector works right. When I try to test my JSON service using the Test Web Service Operation UI, I get an error that says Invalid XML response.
How do I tell Cordys to expect a JSON response instead of an XML?
Is there a way to somehow wrap a JSON in XML through Cordys?
You probably need to change the header:
Content-type: application/json