I'm trying to get Axis2 WebServices to work with JSON Objects for three days, and can't get it right.
They have to receive and return JSON so it can comunicate with an iPhone app. I've tried everything it the first seven pages in Google and got nothing.
I've already put the Message Formatters and Message Builders in axis2.xml. So as jettison jar in the lib folder.
Can someone help me, please? I need an example of how to make this to work.
Thanks!
Related
I used to use the XML endpoint because it provided review dates for each review called 'updated'. This is not contained in the JSON endpoint. However, the XML endpoint stopped working. I get the error seen below:
Web Server Error
Description: The host did not return the document correctly.
Has anyone experienced the same issue? Any workarounds? Do you anticipate this will ever be fixed by Apple? Do you think the JSON endpoint might be taken down any time soon?
XML Endpoint (Broken)
https://itunes.apple.com/us/rss/customerreviews/id=1145275343/mostrecent/xml
JSON Endpoint (Working)
https://itunes.apple.com/us/rss/customerreviews/id=1145275343/mostrecent/json
It appears the XML endpoint is up and running again. No more Web Server Error. Hopefully the endpoint stays up.
I'm pulling my hair out over this.. We had a service in place when we were on Liferay 6.0 that read new entries from out HR database (new hires, terminations, changes, etc). It would then loop through and call the Liferay API using tunnel-web to call the functions to make changes (add user, update user, etc). When we upgraded to 6.2 it broke my custom service and after some trial and error I was able to get some methods working again using the jsonws api.
I worked out a few of them but I am having major problems with user/update-user. I am using VB.net to build a LiferayUser class, call get-user-by-screen-name, fill in values in new LiferayUser object, update values from HR database, convert object to json, call update-user and post the json object.
Right now all I get returned is {"exception":"java.lang.NullPointerException"}. This is also all that shows up in the server logs. I've tried both POST and GET methods, posting a json object. I even tried posting the form parameters to the /invoke method that is used on the api reference.
Has anyone come across this before and resolved it?
I am new to wso2 API Manager, trying to set it up expose my plain HTTP POST back end calls as a REST API. I am sure this is not a new pattern that I am trying to achieve here. The requirement is to convert the JSON data coming in (has array structures) into the HTTP URL query string parameters.
After some research through the documentation and other posts on this forum, decided to go with the script mediator that would parse the JSON data and convert it to a string that can be appended to the endpoint URL. Some how I am not able to achieve this.
I have followed the following post that seems to be very straight forward. As the original poster suggested, I am also not able to use getPayloadJSON() method. Even have trouble using the work around suggested there due to JSON.parse() not working.
Link
Also, this approach of editing the service bus configuration from source view does not sound like the correct option. Is there another elegant solution to achieve this? Thanks for the help in advance.
I was able to get both methods working by using an external script instead of the inline java script. Thanks
I am trying to achieve something like which is mentioned in this link
but i don't know whereto write the parsing code. I tried to write it in new method and added the method in "my adapter.xml" but nothing happens. I even don't know how to log in IBM WorkLight. I used WL.logger(some) but its throwing error that "Logger can not be called on an object".
Any help would be appreciated. Thanks in advance.!
In most cases you don't need to manually parse responses because WL adapter framework will do this for you. Anything you retrieve via WL.Server.invokeHttp API will be parsed to JSON automatically unless you specify returnedContentType:"plain". In case you DO need to manually parse JSON you can use JSON.parse() and JSON.stringify() APIs.
Server side logging is achieved via WL.Logger.debug/error/info etc. You can get more info about it here
You don't have to parse JSON data, there are libraries in Javascript to do that. Try JSON.parse(). You should learning how to write adapters and invoking them from clients. The Getting Started modules are a good place to start, specifically Module 4 in your case.
I'm trying to get a simple AppEngine working that serves as webservices and will delivery content in JSON format.
I'm using Jersey an Jackson, although when I launch the app and access one of the webservices for the first time I get this error:
java.lang.NoClassDefFoundError: com/google/appengine/repackaged/org/codehaus/jackson/xc/JaxbAnnotationIntrospector
If I try to access another WS right after (or try to re-access the current one) then everything seems to go fine. Just not the first time.
Anyone knows how to solve this?
Kr,
Dirk