IONIC Framework (AngularJs & JavaScript) | is SOAP based web-service recommended? - javascript

I am going to use SOAP based web-service for one of my project. (IONIC framework is based on AngularJS and they have written SOAP client in JavaScript)
My Question are:
Is SOAP based web-services recommended using javascript?
Will there be any performance issue ?
What type/kind of issues, i will face during development?
thanks,
Aleem

SOAP is not recommended because it's XML based.
REST is a recommended approach because it is usually based on JSON, which is a native JavaScript format.
With SOAP you will incur overhead of constant JSON / XML conversion.
Here is a comparison: http://spf13.com/post/soap-vs-rest

Is SOAP based web-services recommended using javascript?
It depends on your application you are working on. If you want security in
your application like your are build app for payment system or something then SOAP will be recommended. But you need to compromise in performance. You can also add security by using Oauth or any third party library.
Will there be any performance issue ?
Yes if you compare SOAP performance with Rest then SOAP load time is more than rest api. Because in SOAP we first load xml of service then hit exact function.
What type/kind of issues, i will face during development?
I think you can do whatever you want with SOAP.

Related

Qooxdoo tested json rpc javascript websocket client

I'm starting a new project and I'm using qooxdoo js framework.
I'm running against a json rpc 2.0 server based on websocket communication.
I wonder if there's already a tested json rpc client for qooxdoo or should I pick any implementation like jayson.
Any considerations to take?
i think it's always better to exclude the server communication to the lowest possible layer so you are not dependent on frameworks in case of changes.
We have our communication written in plain javascript.
Regards,
Mark

How IBM Filenet Integrated with Angular application

I'm not familiar with Filenet.
I am using IBM FileNet as document management system. How Can I consume Filenet web services Apis in my AngularJs Application.
Please Help me out, if anyone has tried this.
Thanks
Use the FileNet api to develop a class or web service that returns the records from FileNet and then have the Angular app digest the records returned.
See:
http://www.ibm.com/developerworks/data/library/techarticle/dm-0810carpenter/
and
https://www.ibm.com/support/knowledgecenter/SSNW2F_5.2.1/com.ibm.p8.ce.dev.ce.doc/gs_concepts.htm
In very simple terms, FileNet is a just another content Management system.
It has an API that you use to query the backend(Content Engine) for a
documents that matches your criteria.
Each document you get has content(most of the time, a physical file), and properties (In fileNet terms MetaData).
You will need some technology in the middle to translate the data you aquired to a form that is consumable by Angular (JSON). Something that we can call for the moment a Rest Engine.
This "Engine" should help you expose end points (Simple web addresses http:///Path/To/Data) that is attached to java methods that returns the JSONs you made.
To be able to pull that out successfully, you need to have a good grasp of Angular (Services), and then knowledge of one "Rest Engine" (or something you can use similarly, even a servlet would help you for the moment), and finally a very simple knowledge of FileNet basic operations.
A RESTFUL service tier that leverages FileNet EJB API which are much faster than WS APIs (esp. when in a distributed deployed environment) is to be built for this if you are working in an enterprise-level project.

Server side javascript/java - javascript communication

A) Are there any resources of how to use server-side javascript without Node.js?
B) Can a java-based server communicate with a javascript-based client?
Both options are okay (I would be more happy with the B though).
My goal is a simple client-server communication, and I think, that websocket still doesn't stand on two legs.
I appreciate your answer.
Probably the best part of the REST services that they are language-agnostic. You can write serverside REST services in any language you want, then consume them from a completely different language. The most basic example (what you mentioned in option B) is combining Java and JavaScript. There are plenty of tutorials showing how to do that, maybe this one:
JAX-RS + JQuery
is the best as a starter, because it highlights the important part. Later on you may want to go for some more advanced JS library to produce production-ready code faster.
B is definitely possibly with Jersey JAX-RS and JSON encoded responses. It can automatically parse incoming JSON-formatted query (typically GET/PUT/DELETE) params or body (typically POST) parameters into POJOs and can transform returned POJOs into JSON for the response.
More than possible we do it in production with a Marionette.js and Backbone.js based front-end.
WebSocket requires a bit of custom protocol work on your part and loses caching and other client optimizations. It is s best suited to realtime message-oriented or incremental binary upload/download workloads.

Symfony2 + NodeJS + AngularJS?

I want to start the development of an real time and single-page application with authentification, actions, and notifications.
Is it possible to make the back-end treatment with Symfony whom I know well, and to add NodeJS / AngularJS by above?
This plan will help you has to understand me. Is it possible to apply it, and is it a good practice?
First, I believe we need to clarify some misunderstandings regarding the real time and AngularJS. AngularJS $http and $resource use Ajax in the background.
To have real time communication where the server pushes information to the client (instead of responding to Ajax calls), you would have to use Websockets. There are several alternatives in this domain, for example, socket.io integrates very well with nodejs, Ratchet socketo.me is specific for PHP, or you can use a 3rd party like Pusher through github.com/pusher/pusher-angular.
Second, you can certainly invoke PHP scripts from nodejs, however, unless you have a very specific reason to do so, it seems to me that it defeats the purpose of using nodejs. If you do not have such a requirement on use nodejs.
Of course yes.You can have nodejs and symfony2 in your server.you can use nodejs inside Symfony2 using CLI method.in front-end you can use angular and nodejs (converted).There is nodejs package,which lets you to convert your nodejs code to browser(browserify) side code and you can use it with angularjs.NodeJs has a package called socket.io.You can use it to have biDirectinal connection between server and client.

Relation between ExtJS Direct and DirectJNgine

Am new to ExtJS Direct and DirectJNgine. The relation between them confuses me. I cannot get the overview picture.
What I know is:
ExtJS is a JavaScript framework focusing on UI design. It supplies plethora APIs for programmers. I can call these APIs without bitter.
From the official site:
Ext Direct is a platform and language agnostic technology to remote server-side methods to the client-side. Ext Direct allows for seamless communication between the client-side of an Ext JS application and all popular server platforms.
My think is: ExtJS Direct is also a subset of the APIs supplied the ExtJS team for us to use. These APIs can facilitate our work on calling server side method. But I want to dig into a little bit.
Server side method can be any language method, like JAVA C++ PHP etc. Direct APIs handle all possibilities to support different server side language methods?
From the official site:
DirectJNgine (or DJN, for short), is a Java based implementation of the Ext Direct API for ExtJs.
ExtJs is probably one of the most powerful and attractive UIs for web-based applications, as can be seen here, as well as in many other examples. DirectJNgine makes it much easier to use the full power of Java business classes with such a powerful front-end, making Java methods directly callable from the client.
Since ExtJS Direct is already implemented the APIs for seamless remote method invoking. Why DirectJNgine need to implement these ExtJS Direct APIs? What does "a java based implementation of the Ext Direct API for ExtJs" mean?
I'd add server-side to the definition DirectJNgine:
DirectJNgine is an Open Source library that provides a Java-based implementation of the server-side Ext Direct API.
Ext Direct is a javascript framework and resides on client and let's you call any server API. The call is made via HTTP - that's why it's not dependent on the server language. You formulate a HTTP request, not a Java/PHP/any other request.
Server API handles the HTTP request and can be implemented in Java, C++, PHP, .Net etc. One of the Java implementations is DirectJNgine. It runs on server and responses to Ext Direct calls.
In your project you can use both Ext Direct and DirectJNgine for communication between client and server. They don't overlap, they cooperate with each other on the opposite sides of the network.
And you'd use some framework for the presentation layer (ExtJS maybe) and some framework for server business/storage/other layers (to make use of DirectJNgine it would be a Java framework).
Extjs needs to know the URL, the methods and the parameter count for the possible actions and this is provided by for example DirectJNgine.
The API also takes care of messaging between ExtJS and JAVA , i.e. converting incoming JSON objects to JAVA methods (Json with method names and parameters is passed to JAVA methods, their can be multiple actions in one call). And passing back the result from the JAVA methods in JSON format.
I did a bit of digging into extdirectspring when I realised some strange stuff was going on and wanted to know why. Effectively what extdirect does is provide a description of the server side methods to the client in the form of json (+ possibly through other mediums).
On the client side you end up with objects built from this json that know how to call the server code. In the java (extdirectspring) implementation this creates a static variable in your program's namespace for each of the java classes decorated with the 'ExtDirectMethod' attribute. This variable seems to always be the class name with the first letter lowercased. I had a bit of a dig and this appears to be by coincidence - the name comes from the bean name in spring and is not defined by extdirectspring.
In extdirectspring the setup works through the ether (through the servlet + spring) (have yet to bottom out exactly how this works) and it is predefined to respond to requests for api.js (among other things). This then returns the configuration object which is assigned to a static variable in the ext namespace. By default this variable is called REMOTING_API.
To get the client side stuff to know about what the server has to offer you need to put in a call like:
Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
after extjs has fired up.

Categories