Is it possible with Wicket to use AJAX but invoking a webservice from a different domain from the one serving the original page?
Sure! You can do anything in your code.
There is no need to use Wicket Ajax APIs for this. You can use plain Javascript APIs or jQuery, or any other JS library.
Just make sure the REST service defines proper CORS headers, otherwise you won't be able to reach it via Ajax.
Related
I want to create post request to a webapp that does not have API endpoints.
I want to be able to login, fetch data and post data. I have just stumbled upon GuzzleHttp, but HTTP alone is so hard. The webapp is a laravel application. How can I do this? Or is there elegant way of doing this?
Try Goutte. It uses Guzzle under the hood, but provides higher level interface to deal with web sites.
I would like to consume SalesForce API using JavaScript that running in VF page that already authenticated. Is it possible to do that without another authentication just to get the security token to call REST API?
What would be the alternative to call SalesForce REST service in valid VF page using JavaScript?
Have a look at the Visualforce Remote Objects. It is only in developer preview at the moment but will provide JavaScript proxy objects for DML operations.
Alternatively, you might be better served by JavaScript Remoting or exposing apex web services that you call from your Javascript.
I am developing web application using Symfony2.
Methods in Controller will be called from Web Application but at the same time I need to expose rest api for same functionality. For example Login and get data for a user.
Can one method be configured/written to server the same purpose.
Yes, you need to determine the format of your response (HTML, JSON) from the controller(s), based on a parameter from the request. Have a look at the official Routing documentation: http://symfony.com/doc/current/book/routing.html#book-routing-format-param
Now when it comes to REST applications, FOSRestBundle makes things very easy for you. It allows you to configure format agnostic controllers in bunch. This is well documented in their "The View Layer" section.
Can anybody give me an example/link to build a JSONP web service client? I am trying to create a client to access a third party API to get some data which is working fine making a JSONP ajax call on the front end. I would like to move it to a servlet on the backend. Any help would be appreciated.
Thanks
I want to build an native app with sencha touch2,
But I'm a little confused about the sencha touch proxy
In my app I need to get remote server data, register new user, update data.
So which proxy is best suitable in my situation? Ajax , REST or JSONP?
First of all, make sure that you understand well about Ext.data.proxy.Rest through its documentation details:
http://docs.sencha.com/touch/2-0/#!/api/Ext.data.proxy.Rest
Ext.data.proxy.Rest is a child class of Ext.data.proxy.Ajax so it means that everything you made will actually be transformed into an Ajax request. If your server-side design follows REST pattern completely, it's ideal to use REST proxy. But if there's no URL pattern convention for your backend system, you should simply use Ajax. In fact, you can still use REST in this case but you have to overwrite buildUrl method which is not really productive over pure Ajax proxy.
Ajax and JSONP are basically different about same-domain or cross-domain policy. Ajax is for same-domain request, and JSONP for cross-domain.