Overridding GWT RequestTransport - json

I want to create a GWT client application that retrieves data using RequestFactory. However, I want this client application to hit a JSON webservice backend.
If this is possible at all, it should have something to do with overriding DefaultRequestTransport and setting a new request URL for the data. However, from this point on, the weeds get pretty thick, and the docs are rather thin.
Anyone have any idea if this is possible?

Overriding RequestFactory to work with JSON will be very hard, if at all possible.
Why not use the GWT default support for JSON?

Related

Initialize an Angular page with large json from client?

I am used to creating webapplications with Wicket. There it is possible to generate a HTML page using POST, receiving a large JSON from the client (browser) to generate some charts. This can be done for example with CURL.
In Angular, I could not find a similar approach.
What is the recommended way to render a chart based on the JSON that a browser provides? An URL parameter is not really the way to go as the URL length is limited.
I can think of a work-around wheren I first post the data to some webservice, receive an id, and then pass that id to an URL in Angular, but that seems a lot of work for something simple :)

WSo2 API Manager 1.8.0 - JSON parsing issue

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

Flex, using navigateToURL to send an AMF object and open the response in a new window

I have an application that connects to an AMF gateway exclusively (in a certain mode) and I have a service that renders some HTML that I want to display in a new window outside of the Flex application.
Is it possible, in Flex, to use navigateToURL to send an AMF object and open the response in a new window?
EDIT: More specifically, does anyone have insight into how an AMF request can be properly constructed in actionscript and sent via the POST data of a URLRequest?
UPDATE: Still looking for a clear spec for AMF that makes it obvious how to construct the service call related headers in AMF and what headers are required. Some guidance in this area would be helpful. I've done more reading and have seen some people talk about some custom solutions they have that work in a similar way to what I've mentioned above, although it seems like those solutions are guarded assets. But this further enforces my belief that this is quite possible.
I'd say no... Even if you could create an AMF packet by hand in AS3, how would you pass it to the URL using navigateToURL? How would the browser know how to handle the AMF values returned from your service call?
I suggest you call the AMF gateway service in your Flash app; do the processing that needs done; and then return a URL to the results. In the result handler method, you can open the URL using navigateToURL.
#Flextras is along the right lines - the AMF gateway in particular with AMFPHP isn't used with a URLRequest, instead you use the RPC remoting - most typically RemoteObject where you specify the receiving gateway (ie: endpoint or more generically the destination channel - but this one needs to be in your services-config which resides on the server), and you typically assign a responder to handle the result/failure events (in which your response is almost always a class marked as a [RemoteAlias]).
See: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/remoting/mxml/RemoteObject.html#includeExamplesSummary

Testing PUT methods on a RESTful web service

I have a simple RESTful web service and I wish to test the PUT method on a certain resource. I would like to do it in the most simple way using as few additional tools as possible.
For instance, testing the GET method of a resource is the peak of simplicity - just going to the resource URL in the browser. I understand that it is impossible to reach the same level of simplicity when testing a PUT method.
The following two assumptions should ease the task:
The request body is a json string prepared beforehand. Meaning, whatever is the solution to my problem it does not have to compose a json string from the user input - the user input is the final json string.
The REST engine I use (OpenRasta) understands certain URL decorators, which tell it what is the desired HTTP method. Hence I can issue a POST request, which would be treated as a PUT request inside the REST engine. This means, regular html form can be used to test the PUT action.
However, I wish the user to be able to enter the URL of the resource to be PUT to, which makes the task more complicated, but eases the testing.
Thanks to all the good samaritans out there in advance.
P.S.
I have neither PHP nor PERL installed, but I do have python. However, staying within the realm of javascript seems to be the simplest approach, if possible. My OS is Windows, if that matters.
I'd suggest using the Poster add-on for Firefox. You can find it over here.
As well as providing a means to inspect HTTP requests coming from desktop and web applications, Fiddler allows you to create arbitrary HTTP requests (as well as resend ones that were previously sent by an application).
It is browser-agnostic.
I use the RESTClient firefox plugin (you can not use an URL for the message body but at least you can save your request) but also would recommend curl on the command line.
Maybe you should also have a look at this SO question.

What is the best way to load ASP.Net usercontrols via JSON?

What is the best way to emit an asp.net usercontrol back to the browser based on a JSON request?
So far I have a web service which creates the user control and sends it back to the browser. However when I post back the whole page, I get an error about "the state information is invalid for this page and might be corrupted."
Considering I'm new to Json, I'm going to guess I'm doing it wrong. What's the best way?
Should I just turn off view state validation?
Answer: turn off view state validation.