Worklight HTTP Adapter vs Ajax request - ajax

What are the advantages of using an HTTP Adapter in Worklight IBM to retrieve data from a Restful API instead of an ajax request? I think that using ajax is faster so why would one use such an adapter?

Take a look at the documentation and getting started modules.
Benefits of IBM Worklight adapters
Adapters provide various benefits, as follows:
Fast Development: Adapters are developed in JavaScript and XSL. Developers employ flexible and powerful server-side JavaScript to produce succinct and readable code for integrating with back-end applications and processing data. Developers can also use XSL to transform hierarchical back-end data to JSON.
Read-only and Transactional Capabilities: IBM Worklight adapters support read-only and transactional access modes to back-end systems.
Security: IBM Worklight adapters use flexible authentication facilities to create connections with back-end systems. Adapters offer control over the identity of the user with whom the connection is made. The user can be a system user, or a user on whose behalf the transaction is made.
Transparency: Data retrieved from back-end applications is exposed in a uniform manner, so that application developers can access data uniformly, regardless of its source, format, and protocol.

Related

What exactly does a XMPP server do?

Besides federation (talking to other XMPP server), what's the role of an XMPP server in the communication between two peers?
Wikipedia says that
The XMPP network uses a client–server architecture; clients do not
talk directly to one another.
In that case, they must talk through the server, so messages must go through the server, correct?
Does it role change if we're using XMPP over Websockets, BOSH, or bare TCP?
For instance if we use XMPP over Websockets, is there a Websocket between client1 and the server, and another Websocket between client2 and the server?
An XMPP server provides basic messaging, presence, and XML routing features. This page lists Jabber/XMPP server software that you can use to run your own XMPP service, either over the Internet or on a local area network. Wikipedia is also right. According to wikipedia it means that it uses server client system. It is a system in which a computing system composed of two logical parts: a server, which provides information or services, and a client, which requests them. On a network, for example, users can access server resources from their personal computers using client software. Server client system is widely used for communication purpose and also in DBMS
actually it is a communication protocol for message oriented middle ware ( lies between software and application ) based on xml (extensible markup language ) It enables the near-real-time exchange of structured yet extensible data between any two or more network entities.

Difference between wcf restful services and WEB API

I am query for a long time now.Where exactly we need to use WEB API and where should we use WCF restful services. What ever we want to achieve in WEB API we are able to achieve in WCF Rest. I tried to dig into answers but i got we need to do extra setting in wcf like URI templates,Contracts,endpoints. But its more on settings , but I wanted to known the real reason behind using WCF Restful Services.
Web Service
It is based on SOAP and returns data in XML format.
It supports only the HTTP protocol.
It is not open source but can be consumed by any client that understands XML.
It can be hosted only on IIS.
WCF
It is also based on SOAP and returns data in XML format.
It is the evolution of web services (ASMX) and support various protocols like TCP, HTTP, HTTPS, Named Pipes, MSMQ.
The main issue with WCF is its tedious and extensive configuration.
It is not open source but can be consumed by any client that understands XML.
It can be hosted with in the application or on IIS or using window service.
WCF REST
To use WCF as a WCF REST service you have to enable webHttpBindings.
It supports HTTP GET and POST verbs by [WebGet] and [WebInvoke] attributes respectively.
To enable other HTTP verbs you have to do some configuration in IIS to accept request of that particular verb on .svc files.
Passing data through parameters using a WebGet needs configuration. The UriTemplate must be specified.
It supports XML, JSON and ATOM data format.
Web API
This is the new framework for building HTTP services the easy and simple way.
Web API is open source an ideal platform for building RESTful services using the .NET Framework.
Unlike a WCF REST service, it use the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formats).
It also supports the MVC features such as routing, controllers, action results, filter, model binders, IOC container or dependency injection, unit testing that makes it more simple and robust.
It can be hosted within the application or on IIS.
It is a light weight architecture and good for devices which have limited bandwidth like smart phones.
Responses are formatted by Web API’s MediaTypeFormatter into JSON, XML or whatever format you want to add as a MediaTypeFormatter.
Choosing between WCF or Web API
Choose WCF when you want to create a service that should support special scenarios such as one way messaging, message queues, duplex communication etc.
Choose WCF when you want to create a service that can use fast transport channels when available, such as TCP, Named Pipes, or maybe even UDP (in WCF 4.5), and you also want to support HTTP when all other transport channels are unavailable.
Choose Web API when you want to create a resource-oriented services over HTTP that can use the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formats).
Choose Web API when you want to expose your service to a broad range of clients including browsers, mobiles, iPhone and tablets.
For more details you can refer to http://www.c-sharpcorner.com/UploadFile/8a67c0/who-is-winner-web-api-or-wcf/.

Is RESTful web service secured enough for Banking applications?

I'm going to develop a Banking application that will send and receive information to mobile devices of bank account holder. I want to use REST api of Spring framework for this purpose. Is there any bank that uses RESTful api for applications?
Does RESTful api provide enough security for this purpose?
Or should I stick to use SOAP web service?
I know, this question is asked several times. But I want to concentrate on feasibility of REST api for Banking domain.
Most banks still use SOAP for integration, but you could find examples of companies like Visa or Paypal which expose their api in a RESTful way.
There is a key difference between using SOAP with WS-Security and a REST api with SSL, thats WS-Security which offers end-to-end security (offers confidentiality and integrity protection from the source of the message to the receiver).
What we are dealing here is security at two different levels: HTTPS applies at the transport layer (which you could apply to REST or SOAP service) and WS-Security applies at the application layer.
But now you could deal with REST using OAuth2, check on how Paypal uses it here.
Another question related: Secure Web Services: REST over HTTPS vs SOAP + WS-Security. Which is better?
Yes, it is as secure (or insecure) as any other method including SOAP. You still have to follow all best practices while writing your application (using https everywhere, encrypting sensitive data, making sure you don't write sensitive data to logs in plain text, and so on). It is best to discuss with the Security team for your bank/company, they'll usually have a set of requirements that you need to follow to secure your application.
From security perspective REST over HTTPS is good enough unless you need end-to-end security or you have compliance limitations.
If your banking mobile application will communicate through any intermediates (this could be NFC, Bluetooth Low Energy enabled POS e.g.) then I would recommend considering end-to-end security depending on risks and sensitivity of the information you are planning to send. Unfortunately there is no end-to-end security mechanism I can recommend for banking app except WS-Security. I had a look at many solutions like JSON Web Encryption (JWE), Javascript Object Signing and Encryption (JOSE), OAuth 1.0 Signature and others. I've found no solution which provides end-to-end security with respect to Integrity, Confidentiality, Authenticity for RESTful web-services out-of-the-box. The reason is that RESTful web-services are assumed to work always over HTTP and thus they will be protected with HTTPS. So if you need end-to-end security it's a good point to think about SOAP and WS-Security.
Another reason to think on WS-Security could be compliance regulations like PCI DSS. Then you can reduce compliance scope with end-to-end encryption of cardholder data. Good example is what Netflix guys did https://youtu.be/sYFDnGjNVrk. So investigate your compliance regulation if you have such before making a decision.

How does a JDBC driver implementation work?

A JDBC driver implementation provides the low level details that allows a client to communicate with a third party datababase. I am just curious what it is doing behind the scenes. Communication between two systems written in different languages usually happens through web services.
Does the jdbc driver use web services to communicate between the client and the db server? Or am i oversimplifying?
People who write JDBC drivers have several options to choose from:
Type 1 driver: Use the generic JDBC-ODBC bridge, don't actually make a driver.
Type 2: Make a "wrapper" that uses JNI to call functions in a native client library.
Type 3: A generic driver that connects to a "middleware" service that talks with the database.
Type 4: a pure-Java implementation of the database communication protocol.
A type 3 driver might use web services to talk with the middleware. The other types of driver most likely communicate in a database-specific binary protocol over TCP/IP sockets (if the database is on a remote host) or other suitable reliable transport, not through web services.
You should check this link as this shows you how JDBC works.
Now coming to your question : No JDBC do not use web services. The way it connects to different types of databases is due to the database vendors because different database vendors provide their own driver implementation and you just need to use that implementation. There's nothing like web services. Each database vendor provides you with some api of their own to access database which they map to the Java's api to access database which is generic.
Java is provides a generic api for database operations which ultimately does operations and communication with database using sockets.
So what you need to read is TCP/IP , Socket programming, IO and JDBC. Please don't forget to check the link it will surely help you understand the concept.

Asynchronous messaging (ActiveMQ, MSMQ) to ASP application (MVC3)

I have been reading articles about asynchronous messaging between clients using MVC3 and the SignalR library (http://sergiotapia.com/2011/09/signalr-with-mvc3-chat-app-build-asynchronous-real-time-persistant-connection-websites/)
We currently use activemq for some of our fat client apps and use topics to broadcast data to everyone. Does anyone know if this sort of thing could be used in MVC3 as well?
I'd like to create an application that doesn't require a user to install anything (and could even be used on a phone), but it would be monitoring continuously-changing data. We're talking refreshing data every 2-3 seconds.
If you want to have asynchronous messaging with client (browser) use SignalR. ActiveMQ and MSMQ are technologies for thick clients and server-to-server communication. They require installation (MSMQ requires windows installation) and they are not accessible from browser (well I can imagine accessing MSMQ through ActiveX or ActiveMQ from Java applet but that is not what you are looking for).
One of the possible ways to go is to build a web service which will implement communication with AMQ/MSMQ via their APIs and do poll this web service from your webpage (via ajax call for example) to refresh the data as it's needed.

Resources