dineshonjava

AJAX Tutorial

Ajax tutorial logo

In this AJAX tutorial we discuss about asynchronous call for servers. AJAX, short form of Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications.

AJAX meant to increase the web page's interactivity, speed, and usability. AJAX is not a new programming language, but a new way to use existing standards. AJAX is the art of exchanging data with a server, and updating parts of a web page - without reloading the whole page.

AJAX allows you to send only important information to the server not the entire page. So only valuable data from the client side is routed to the server side. It makes your application interactive and faster.

Ajax uses XHTML for content and CSS for presentation, as well as the Document Object Model and JavaScript for dynamic content display.

AJAX is a web browser technology independent of web server software.

A user can continue to use the application while the client program requests information from the server in the background.

Intuitive and natural user interaction. No clicking required only Mouse movement is a sufficient event trigger.

Data-driven as opposed to page-driven.

Used?
There are many web applications now a days using Ajax technologies in the web application as like gmail, facebook, twiter, etc.


Contents for AJAX
AJAX Intro
Synchronous and Async in AJAX
AJAX XMLHttp
AJAX Request
AJAX Response



Community Cloud Model in Cloud Computing

Community cloud shares infrastructure between several organizations from a specific community with common concerns (security, compliance, jurisdiction, etc.), whether managed internally or by a third-party and hosted internally or externally. The costs are spread over fewer users than a public cloud (but more than a private cloud), so only some of the cost savings potential of cloud computing are realized.

Community Cloud Model in Cloud Computing

Benefits of Community Cloud Model

Cost Effective-
Community cloud offers same advantage as that of private cloud at low cost.

Sharing Between Organizations-
Community cloud provides an infrastructure to share cloud resources and capabilities among several organizations.

Security-
Community cloud is comparatively more secure than the public cloud.

Disadvantages of Community Cloud Model

Data accessible between Organizations-
Since all data is housed at one location, one must be careful in storing data in community cloud because it might be accessible by others.

Challenging in Responsibilities-
It is also challenging to allocate responsibilities of governance, security and cost.




<<Previous <<   || Index ||   >>Next >>








Hybrid Cloud Model in Cloud Computing

In this cloud tutorial we will discuss about the Hybrid Cloud Model, it is the mixture of public and private cloud. Non-critical activities are performed by public cloud while critical activities are performed by private cloud.

Hybrid Cloud Model in Cloud Computing

Benefits of Hybrid Cloud Model

Scalable-
It provides both the features of public and private cloud scalability.

Security-
Private cloud in hybrid cloud ensures higher degree of security.

Flexible and secure-
It provides secure resources because of private cloud and scalable resources because of public cloud.

Cost effective-
It is having less cost as compared to private cloud.

Disadvantages of Hybrid Cloud Model

Network Issue -
Networking becomes complex due to presence of private and public cloud.

Security Compliance-
It is necessary to ensure that cloud services are compliant with the security policies of an organization.

Infrastructural Dependency-
The hybrid cloud model is dependent on internal IT infrastructure, therefore it is necessary to ensure redundancy across data centers.









<<Previous <<   || Index ||   >>Next >>








Private Cloud Model in Cloud Computing

In this cloud tutorial we will talking about one of the cloud model is private cloud model in the Private Cloud allows systems and services to be accessible with in an organization. The Private Cloud is operated only within a single organization. However, It may be managed internally or by third-party.

Private Cloud Model in Cloud Computing

Benefits of Private Cloud Model

High security and privacy-
Private cloud resources are shared from distinct pool of resources and hence highly secured.

More Control-
Private clouds have more control on its resources and hardware than public cloud because it is accessed only within the boundary of an organization.

Cost & Energy Efficiency-
Private cloud resources are not as cost effective as public clouds but they offer more efficiency than public cloud.

Disadvantages of Private Cloud Model

Restriction-
Private cloud is only accessible locally and it is very difficult to deploy globally.

Less Scalability-
Private clouds are scaled only within capacity of internal hosted resources.

Additional Skills-
In order to maintain cloud deployment, organization requires more skilled and expertise.

Inflexible Costing-
In order to fulfill demand, purchasing new hardware is very costly.




<<Previous <<   || Index ||   >>Next >>



Public Cloud in Cloud Computing

A cloud is called a "public cloud" when the services are rendered over a network that is open for public use. Technically there may be little or no difference between public and private cloud architecture, however, security consideration may be substantially different for services (applications, storage, and other resources) that are made available by a service provider for a public audience and when communication is effected over a non-trusted network. Generally, public cloud service providers like Amazon AWS, Microsoft and Google own and operate the infrastructure and offer access only via Internet.

Public Cloud in Cloud Computing

Benefits of Public Cloud Model-

1. Low Cost
Public cloud is having low cost as compared to private or hybrid cloud, because it shares same resources with large number of consumer.

2. Reliable
Public cloud provides large number of resources from different locations, if any of the resource fail, public cloud can employ another one.

3. Flexible
It is very easy to integrate public cloud with private cloud and hence it gives flexible approach to consumers.

4. Location Independent
It ensures the independency of location, because public cloud services are delivered through Internet.

5. High Scalability
Cloud resources are available as per the demand from the pool of resources that means they can be scaled up or down according to the requirement.

Risks of Public Cloud

Here are the disadvantages of public cloud model:

1. LOW SECURITY
In public cloud model, data is hosted off-site and resources are shared publicly, therefore does not ensure higher level of security.

2. LESS CUSTOMIZABLE
It is comparatively less customizable than private cloud.






<<Previous <<   || Index ||   >>Next >>








Network-as-a-Service (NaaS)

In cloud computing Network as a Service (NaaS) is provide remote network infrastructure as service securely with less cost. NaaS makes it possible to deploy custom routing protocols.

NaaS provide virtual network Infrastructure to provide network service to the business consumers. NaaS manage the network and security related responsibilities and also manage resources uses by consumers and decreases the workload. NaaS is also based on pay per use model.

Benefits of Network as-a-Service:

1. Near you and your end users.
More than 95% of the world’s enterprise business users are within 20 milliseconds from any of our POPS. Multi-segment TCP optimization technology minimizes the application performance impact of packet loss on both the first and last mile.

2. Service, not boxes.
You subscribe for the bandwidth you need, when you need it, instead of building your WAN for future growth. We offer global on-demand capacity, so you can quickly add bandwidth at any location.

3. Connect in minutes.
You can be up and running in minutes, not the days, weeks or even months it can take to deploy MPLS. You simply connect into the network using an IPSec-capable edge device over your business-class Internet connection (or a direct L2 connection) to one or more of our nearest POPs.

4.QoS.
Our network honors your Quality of Service (QoS) markings to prioritize business-critical applications by class (such as for real-time applications) over other data traveling across the network, guaranteeing performance levels. The ability to burst above your subscription provides even more capacity for peak loads without additional cost.

5. Security.
We can connect an IPSec VPN directly into the network at the closest POP for those cloud services that require secure private access. For us, this is as simple as setting up any other location on the private network.

6. Visibility.
Our web-based portal delivers end-to-end network-wide visibility. With our service-based offering, we do all of the management for you, providing 24/7 support via Network Operations Centers (NOCs) located on opposite sides of the world.



Some service models are

1. Virtual Private Network (VPN): Extends a private network and the resources contained in the network across networks like the public Internet.

2. Bandwidth on demand (BoD): Technique by which network capacity is assigned based on requirements between different nodes or users.

3. Mobile network virtualization: Model in which a telecommunications manufacturer or independent network operator builds and operates a network (wireless, or transport connectivity) and sells its communication access capabilities to third parties (commonly mobile phone operators) charging by capacity utilization.





<<Previous <<   || Index ||   >>Next >>








Identity as a Service (IDaaS)

Suppose one IT Company have thousands of Employees and that IT company share resources of multiple tasks with different login ID and password. In my office Times have different portal like TJ, MB, IndiaTimes, TOI, SM etc. these portal have login functionality for all users so its very difficult to manage all login IDs for each portal.

To solve above problems, a new technique emerged which is known as Identity as a Service (IDaaS). Identity as a Service (IDaaS) is an authentication infrastructure that is built, hosted and managed by a third-party service provider. IDaaS can be thought of as single sign-on (SSO) for the cloud.

Single Sign-On (SSO)

To solve the problem of using different username & password combination for different servers, companies now employ Single Sign-On software, which allows the user to login only one time and manages the user's access to other systems.

SSO has single authentication server, managing multiple accesses to other systems, as shown in the following diagram:
Identity as a Service (IDaaS)

Working of SSO

Following steps explain the working of Single Sign-On software:
1. User logs into the authentication server using a username and password.
2. The authentication server returns the user's token.
3. User sends the token to intranet server.
4. Intranet server sends the token to the authentication server.

Authentication server sends the user's security credentials for that server back to the intranet server.

IDaaS

Benefits of IDaaS Cloud Computing layer

1. Increased site conversation rates.
2. Access to greater user profile content.
3. Fewer problems with lost passwords.
4. Ease of content integration into social networking sites.

Examples-

It offers users to login into multiple websites with single account. Google, Yahoo!, Flickr, MySpace, WordPress.com are some of the companies that support OpenID.


References
1. http://ccskguide.org/cloud-identity-as-a-service-idaas/


<<Previous <<   || Index ||   >>Next >>







Software as a Service (SaaS)

Software as a Service(SaaS) is one of the most important module or layer of cloud computing. SaaS means Software on demand, it provide distributed software to business customer. In SaaS, software and associated data are centrally hosted on the cloud server. SaaS is accessed by users using a thin client via a web browser. Some of the below components which use as SaaS-

1. Billing and Invoicing System
2. Customer Relationship Management (CRM) applications
3. Help Desk Applications
4. Human Resource (HR) Solutions

SaaS is service oriented architecture (SOA). Software as a Service (SaaS) delivers business processes and applications, such as CRM, collaboration, and email, as standardized capabilities for a usage-based cost at an agreed, business-relevant service level. SaaS provides significant efficiencies in cost and delivery in exchange for minimal customization and represents a shift of operational risks from the consumer to the provider. All infrastructure and IT operational functions are abstracted away from the consumer.

Software as a Service (SaaS)

Benefits of SaaS cloud computing layer

1. No additional hardware costs-
the processing power required to run the applications is supplied by the cloud provider.

2. No initial setup costs-
applications are ready to use once the user subscribes.

3. Pay for what you use-
if a piece of software is only needed for a limited period then it is only paid for over that period and subscriptions can usually be halted at any time.

4. Usage is scalable-
if a user decides they need more storage or additional services, for example, then they can access these on demand without needing to install new software or hardware.

5. Updates are automated-
whenever there is an update it is available online to existing customers, often free of charge. No new software will be required as it often is with other types of applications and the updates will usually be deployed automatically by the cloud provider.

6. Cross device compatibility-
SaaS applications can be accessed via any internet enabled device, which makes it ideal for those who use a number of different devices, such as internet enabled phones and tablets, and those who don’t always use the same computer.

7. Accessible from any location-
rather than being restricted to installations on individual computers, an application can be accessed from anywhere with an internet enabled device.
8. Applications can be customized and white-labelled-
with some software, customisation is available meaning it can be altered to suit the needs and branding of a particular customer.

Risks of SaaS cloud computing layer-

1. Security
Actually data is stored in cloud, so security may be an issue for some users. However, cloud computing is not more secure than in-house deployment. Learn more cloud security.

2. Latency issue
Because the data and application are stored in cloud at a variable distance from the end user, so there is a possibility that there may be more latency while interacting with the application than a local deployment. So, SaaS model is not suitable for applications whose demand response times are in milliseconds.

3. Total Dependency on Internet
Without internet connection, most SaaS applications are not usable.

4. Portability between SaaS vendors is difficult
Transferring workloads from one SaaS cloud to another is not so easy because work flow, business logics, user interfaces, support scripts can be provider specific.

References
1. http://en.wikipedia.org/wiki/Cloud_computing#Software_as_a_service_.28SaaS.29
2. http://en.wikipedia.org/wiki/Software_as_a_service



<<Previous <<   || Index ||   >>Next >>



Platform as a Service (PaaS)

Platform as a Service, often simply referred to as PaaS, is a category of cloud computing that provides a platform and environment to allow developers to build applications and services over the internet. PaaS services are hosted in the cloud and accessed by users simply via their web browser.

Platform as a Service (PaaS) delivers application execution services, such as application runtime, storage, and integration for applications written for a pre-specified development framework. PaaS provides an efficient and agile approach to operate scale-out applications in a predictable and cost-effective manner. Service levels and operational risks are shared because the consumer must take responsibility for the stability, architectural compliance, and overall operations of the application while the provider delivers the platform capability (including the infrastructure and operational functions) at a predictable service level and cost.

Platform as a Service allows users to create software applications using tools supplied by the provider. PaaS services can consist of preconfigured features that customers can subscribe to; they can choose to include the features that meet their requirements while discarding those that do not. Consequently, packages can vary from offering simple point-and-click frameworks where no client side hosting expertise is required to supplying the infrastructure options for advanced development.

The following diagram shows how PaaS offers an API and development tools to the developers and how it helps the end user to access business applications.

Platform as a Service

Benefits of PaaS cloud computing layer

1) Simplified Development

Developers can focus on development and innovation without worrying about the infrastructure.

2) Lower risk

No requirements of up-front investment in hardware and software. Developers only need a PC and an internet connection to start building applications.

3) Prebuilt business functionality

Some PaaS vendors also provide already defined business functionality so that users can avoid building everything from very scratch and hence can directly start the projects only.

4) Instant community

PaaS vendors frequently provides online communities where developer can get the ideas, share experiences and seek advice from others.

5) Scalability

Applications deployed can scale from one to thousands of users without any changes to the applications.

Disadvantages of PaaS Layer

1) Vendor lock-in

One have to write the applications according to the platform provided by PaaS vendor so migration of an application to another PaaS vendor would be a problem.

2) Data Privacy

Corporate data, whether it can be critical or not, will be private so if it is not located within the walls of the company there can be a risk in terms of privacy of data.

3) Integration with the rest of the systems applications

It may happen that some applications are local and some are in cloud. So there will be chances of increased complexity when we want to use data which in the cloud with the local data.

PaaS Types
Based on the functions, the PaaS can be classified into four types as shown in the following diagram:

Platform as a Service  (PaaS)

Top vendors who are providing PaaS cloud computing platform

  • Google Apps Engine (GAE)
  • SalesFroce.com
  • Windows Azure
  • AppFog
  • Openshift
  • Cloud Foundary from VMware

References
1. http://en.wikipedia.org/wiki/Platform_as_a_service


<<Previous <<   || Index ||   >>Next >>







Infrastructure as a service (IaaS)

In cloud computing there are many layers exist in picture. IaaS is one of most important layer which provide IT infrastructure to the customer organization such as servers, networking, processing, storage, virtual machines and other resources. Customers access these resources over internet i.e. cloud computing platform, on a pay-per-use model. Infrastructure as a Service is sometimes referred to as Hardware as a Service (HaaS).

Infrastructure as a service (IaaS)

Salient examples of how IaaS can be utilized by enterprise:

Cloud hosting-

the hosting of websites on virtual servers which are founded upon pooled resources from underlying physical servers. A website hosted in the cloud, for example, can benefit from the redundancy provided by a vast network of physical servers and on demand scalability to deal with unexpected demands placed on the website.

Enterprise infrastructure-

by internal business networks, such as private clouds and virtual local area networks, which utilise pooled server and networking resources and in which a business can store their data and run the applications they need to operate day-to-day. Expanding businesses can scale their infrastructure in accordance with their growth whilst private clouds (accessible only by the business itself) can protect the storage and transfer of the sensitive data that some businesses are required to handle.

Virtual Data Centers (VDC)-

a virtualised network of interconnected virtual servers which can be used to offer enhanced cloud hosting capabilities, enterprise IT infrastructure or to integrate all of these operations within either a private or public cloud implementation.

IaaS offering can deliver the following features and benefits:

Scalability-

resource is available as and when the client needs it and, therefore, there are no delays in expanding capacity or the wastage of unused capacity

No investment in hardware-

the underlying physical hardware that supports an IaaS service is set up and maintained by the cloud provider, saving the time and cost of doing so on the client side.

Utility style costing-

the service can be accessed on demand and the client only pays for the resource that they actually use

Location independence-

the service can usually be accessed from any location as long as there is an internet connection and the security protocol of the cloud allows it.

Physical security of data centre locations-

services available through a public cloud, or private clouds hosted externally with the cloud provider, benefit from the physical security afforded to the servers which are hosted within a data centre

No single point of failure-

if one server or network switch, for example, were to fail, the broader service would be unaffected due to the remaining multitude of hardware resources and redundancy configurations. For many services if one entire data center were to go offline, nevermind one server, the IaaS service could still run successfully.

Disadvantages of IaaS cloud computing layer

There is a risk of IaaS cloud computing platform vendor by gaining the access to the organization???s data. But it can be avoided by opting for private cloud.

1) IaaS cloud computing platform model is dependent on internet availability.
2) It is also dependent on the availability of virtualization services.
3) IaaS cloud computing platform can limit the user privacy and customization options.

Some key point remember about IaaS-

1. IaaS cloud computing platform may not eliminate the need for an in-house IT department. It will be needed to monitor or control the IaaS setup. IT salary expenditure might not reduce significantly, but other IT expenses can be reduced.

2. The IaaS cloud computing platform vendor can get access to your sensitive data. So, engage with the credible companies or organizations. Study their security policies and precautions.

3. IaaS cloud computing platform cannot replace traditional hosting method but it provides more than that and each resources which are used are predictable as per the usage.

Vendors who provides IaaS-

1. Amazon Web Services

Elastic, Elastic Compute Cloud (EC2) MapReduce, Route 53, Virtual Private Cloud, etc.

2. Netmagic Solutions

Netmagic runs from data centers in Mumbai, Chennai, and Bangalore, and a virtual data center in the United States. Plans are underway to extend services to West Asia.

3. Reliance Communications

RIDC supports both traditional hosting and cloud services, with data centers in Mumbai, Bangalore, Hyderabad, and Chennai. The cloud services offered by RIDC include IaaS and SaaS.

4. Sify Technologies (Sify IaaS)

Sify's cloud computing platform is powered by HP's converged infrastructure. The vendor offers all three types of cloud services: IaaS, PaaS, and SaaS.


References
1. http://en.wikipedia.org/wiki/Cloud_computing#Infrastructure_as_a_service_.28IaaS.29



<<Previous <<   || Index ||   >>Next >>







Cloud Infrastructure Components

In this tutorial we will give basic description about the cloud infrastructure components. Cloud infrastructure contains of servers, storage, network, management software, and deployment software and platform virtualization.

Cloud Infrastructure Components

STORAGE

Cloud uses distributed file system for storage purpose. If one of the storage resource fails, then it can be extracted from another one which makes cloud computing more reliable.

NETWORK

Network is the key component of cloud infrastructure. It allows to connect cloud services over the Internet. It is also possible to deliver network as a utility over the Internet, i.e., the consumer can customize the network route and protocol.

SERVER

Server helps to compute the resource sharing and offer other services such as resource allocation and deallocation, monitoring resources, security, etc.

HYPERVISOR

Hypervisor is a firmware or low-level program that acts as a Virtual Machine Manager. It allows to share the single physical instance of cloud resources between several tenants.

Facalities

1. MANAGEMENT SOFTWARE
Management Software helps to maintain and configure the infrastructure.

2. DEPLOYMENT SOFTWARE
Deployment software helps to deploy and integrate the application on the cloud.


Constraints for Infrastructure



Cloud Infrastructure

SECURITY

The mega data center in the cloud should be securely architectured. Also the control node, a entry point in mega data center also needs to be secure.

MONITORING

To achieve transparency and scalability, application solution delivery will need to be capable of intelligent monitoring.

TRANSPARENCY

Since virtualization is the key to share resources in cloud environment. But it is not possible to satisfy the demand with single resource or server. Therefore, there must be transparency in resources, load balancing and application, so that we can scale them on demand.

SCALABILITY

Scaling up an application delivery solution is not that easy as scaling up an application because it involves configuration overhead or even re-architecting the network. So, application delivery solution is need to be scalable which will require the virtual infrastructure such that resource can be provisioned and de-provisioned easily.



<<Previous <<   || Index ||   >>Next >>



Cloud Computing Architecture

Whenever we are talking about cloud computing then there are two components come into picture 1. Front end and 2. Back end. They are connected to each other through internet. The front end is the side the computer user, or client, sees. The back end is the "cloud" section of the system.

Cloud Computing Architecture

Cloud client platforms-Front End

The front end includes the client's computer (or computer network) and the application required to access the cloud computing system. Not all cloud computing systems have the same user interface.

Cloud storage-Back End

On the back end of the system are the various computers, servers and data storage systems that create the "cloud" of computing services.

A central server administers the system, monitoring traffic and client demands to ensure everything runs smoothly. It follows a set of rules called protocols and uses a special kind of software called middle-ware. Middle-ware allows networked computers to communicate with each other. Most of the time, servers don't run at full capacity. That means there's unused processing power going to waste. It's possible to fool a physical server into thinking it's actually multiple servers, each running with its own independent operating system. The technique is called server virtualization. By maximizing the output of individual servers, server virtualization reduces the need for more physical machines.


Important Points
  1. It is the responsibility of the back end to provide built-in security mechanism, traffic control and protocols.
  2. The server employs certain protocols, known as middleware, helps the connected devices to communicate with each other.

References
1. http://en.wikipedia.org/wiki/Cloud_computing_architecture


<<Previous <<   || Index ||   >>Next >>







How Does Cloud Computing Work?

Cloud computing has been changing how most people use the web and how they store their files. It’s the structure that runs sites like Facebook, Amazon and Twitter and the core that allows us to take advantage of services like Google Docs and Gmail. But how does it work?

Before we dig further into how does cloud computing work, first let’s understand what the term “cloud“ refers to. The concept of the cloud has been around for a long time in many different incarnations in the business world. It mostly means a grid of computers serving as a service-oriented architecture to deliver software and data.

Most websites and server-based applications run on particular computers or servers. What differentiates the cloud from the way those are set up is that the cloud utilizes the resources from the computers as a collective virtual computer, where the applications can run independently from particular computer or server configurations. They are basically floating around in a “cloud of resources”, making the hardware less important to how the applications work.
For example, if you are hosting your website on a local server or from your PC, you must usually select a particular operating system (Windows/Linux/Mac), to determine what software you can run on that particular server. If your site is being hosted in the cloud, there is no need to do that. You can run Windows and Linux programs side by side.


How is that done?

To understand how does cloud computing work, imagine that the cloud consists of layers — mostly the back-end layers and the front-end or user-end layers. The front-end layers are the ones you see and interact with. When you access your email on Gmail for example, you are using software running on the front-end of a cloud. The same is true when you access your Facebook account. The back-end consists of the hardware and the software architecture that fuels the interface you see on the front end.
Because the computers are set up to work together, the applications can take advantage of all that computing power as if they were running on one particular machine. Cloud computing also allows for a lot of flexibility. Depending on the demand, you can increase how much of the cloud resources you use without the need for assigning specific hardware for the job, or just reduce the amount of resources assigned to you when they are not necessary.

How Does Cloud Computing Work?

Clouds use a network layer to connect users’ end point devices, like computers or smart phones, to resources that are centralised in a data centre. Users can access the data centre via a company network or the internet or both. Clouds can also be accessed from any location, allowing mobile workers to access their business systems on demand.

Applications running on the cloud take advantage of the flexibility of the computing power available. The computers are set up to work together so that it appears as if the applications were running on one particular machine. This flexibility is a major advantage of cloud computing, allowing the user to use as much or as little of the cloud resources as they want at short notice, without any assigning any specific hardware for the job in advance.




<<Previous <<   || Index ||   >>Next >>



History of Cloud Computing

The concept of Cloud Computing came into existence in 1950 with implementation of mainframe computers, accessible via thin/static clients. Since then, cloud computing has been evolved from static clients to dynamic ones from software to services. The following diagram explains the evolution of cloud computing:

History of Cloud Computing

Before emerging the cloud computing, there was Client/Server computing which is basically a centralized storage in which all the software applications, all the data and all the controls are resided on the server side.

If a single user wants to access specific data or run a program, he/she need to connect to the server and then gain appropriate access, and then he/she can do his/her business.

Then after, distributed computing came into picture, where all the computers are networked together and share their resources when needed.

On the basis of above computing, there was emerged of cloud computing concepts that later implemented.

At around in 1961, John MacCharty suggested in a speech at MIT that computing can be sold like a utility, just like a water or electricity. It was a brilliant idea, but like all brilliant ideas, it was ahead if its time, as for the next few decades, despite interest in the model, the technology simply was not ready for it.

But of course time has passed and the technology caught that idea and after few years we mentioned that:

In 1999, Salesforce.com started delivering of applications to users using a simple website. The applications were delivered to enterprises over the Internet, and this way the dream of computing sold as utility were true.

In 2002, Amazon started Amazon Web Services, providing services like storage, computation and even human intelligence. However, only starting with the launch of the Elastic Compute Cloud in 2006 a truly commercial service open to everybody existed.

In 2009, Google Apps also started to provide cloud computing enterprise applications.

Of course, all the big players are present in the cloud computing evolution, some were earlier, some were later. In 2009, Microsoft launched Windows Azure, and companies like Oracle and HP have all joined the game. This proves that today, cloud computing has become mainstream.


 References
1. http://en.wikipedia.org/wiki/Cloud_computing#History



<<Previous <<   || Index ||   >>Next >>







Disadvantages of Cloud Computing

As made clear from the above, cloud computing is a tool that offers enormous benefits to its adopters. However, being a tool, it also comes with its set of problems and inefficiencies. Let’s address the most significant ones.

Security and privacy in the Cloud

Security is the biggest concern when it comes to cloud computing. By leveraging a remote cloud based infrastructure, a company essentially gives away private data and information, things that might be sensitive and confidential. It is then up to the cloud service provider to manage, protect and retain them, thus the provider’s reliability is very critical. A company’s existence might be put in jeopardy, so all possible alternatives should be explored before a decision. On the same note, even end users might feel uncomfortable surrendering their data to a third party.

Similarly, privacy in the cloud is another huge issue. Companies and users have to trust their cloud service vendors that they will protect their data from unauthorized users. The various stories of data loss and password leakage in the media does not help to reassure some of the most concerned users.

Dependency and vendor lock-in

One of the major disadvantages of cloud computing is the implicit dependency on the provider. This is what the industry calls “vendor lock-in” since it is difficult, and sometimes impossible, to migrate from a provider once you have rolled with him. If a user wishes to switch to some other provider, then it can be really painful and cumbersome to transfer huge data from the old provider to the new one. This is another reason why you should carefully and thoroughly contemplate all options when picking a vendor.

Technical Difficulties and Downtime

Certainly the smaller business will enjoy not having to deal with the daily technical issues and will prefer handing those to an established IT company, however you should keep in mind that all systems might face dysfunctions from time to time. Outage and downtime is possible even to the best cloud service providers, as the past has shown.

Additionally, you should remember that the whole setup is dependent on internet access, thus any network or connectivity problems will render the setup useless. As a minor detail, also keep in mind that it might take several minutes for the cloud to detect a server fault and launch a new instance from an image snapshot.

Limited control and flexibility

Since the applications and services run on remote, third party virtual environments, companies and users have limited control over the function and execution of the hardware and software. Moreover, since remote software is being used, it usually lacks the features of an application running locally.

Increased Vulnerability

Related to the security and privacy mentioned before, note that cloud based solutions are exposed on the public internet and are thus a more vulnerable target for malicious users and hackers. Nothing on the Internet is completely secure and even the biggest players suffer from serious attacks and security breaches. Due to the interdependency of the system, If there is a compromise one one of the machines that data is stored, there might be a leakage of personal information to the world.

Require a constant Internet Connection

Cloud computing is impossible without Internet connection. To access any applications and documents you need a constant Internet connection.

 Require High Speed Internet connection

Similarly, a low-speed Internet connection makes cloud computing painful at best and often impossible. Web based apps often require a lot of bandwidth to download, as need to download large documents.

 Stored Data Might Not Be Secure

With cloud computing, all your data is stored in the cloud. That's all well and good, but how secure is the cloud? Can't unauthorized users gain access to your confidential data?

Conclusion

Despite its disadvantages and the fact that it is still in an infant age, cloud computing remains strong and has great potential for the future. Its user base grows constantly and more big players are attracted to it, offering better and more fine tuned services and solutions. We can only hope that the advantages will further grow and the disadvantages will be mitigated, since cloud computing seems to have made IT a little bit easier. Happy cloud computing!



 References
1. http://en.wikipedia.org/wiki/Cloud_computing#Issues
2. http://www.verio.com/resource-center/articles/cloud-computing-benefits/


<<Previous <<   || Index ||   >>Next >>


Advantages of Cloud Computing

Cloud computing offers numerous advantages both to end users and businesses of all sizes. The obvious huge advantage is that you no more have to support the infrastructure or have the knowledge necessary to develop and maintain the infrastructure, development environment or application, as were things up until recently. The burden has been lifted and someone else is taking care of all that. Business are now able to focus on their core business by outsourcing all the hassle of IT infrastructure.

There are various advantages of cloud computing technology. The important advantages of cloud computing are given below.

Reduced IT costs

Moving to cloud computing may reduce the cost of managing and maintaining your IT systems. Rather than purchasing expensive systems and equipment for your business, you can reduce your costs by using the resources of your cloud computing service provider. You may be able to reduce your operating costs because:
  • the cost of system upgrades, new hardware and software may be included in your contract
  • you no longer need to pay wages for expert staff
  • your energy consumption costs may be reduced
  • there are fewer time delays.

Scalability

Your business can scale up or scale down your operation and storage needs quickly to suit your situation, allowing flexibility as your needs change. Rather than purchasing and installing expensive upgrades yourself, your cloud computer service provider can handle this for you. Using the cloud frees up your time so you can get on with running your business.

Business continuity

Protecting your data and systems is an important part of business continuity planning. Whether you experience a natural disaster, power failure or other crisis, having your data stored in the cloud ensures it is backed up and protected in a secure and safe location. Being able to access your data again quickly allows you to conduct business as usual, minimising any downtime and loss of productivity.

Collaboration efficiency

Collaboration in a cloud environment gives your business the ability to communicate and share more easily outside of the traditional methods. If you are working on a project across different locations, you could use cloud computing to give employees, contractors and third parties access to the same files. You could also choose a cloud computing model that makes it easy for you to share your records with your advisers (e.g. a quick and secure way to share accounting records with your accountant or financial adviser).

Flexibility of work practices

Cloud computing allows employees to be more flexible in their work practices. For example, you have the ability to access data from home, on holiday, or via the commute to and from work (providing you have an internet connection). If you need access to your data while you are off-site, you can connect to your virtual office, quickly and easily.

Access to automatic updates

Access to automatic updates for your IT requirements may be included in your service fee. Depending on your cloud computing service provider, your system will regularly be updated with the latest technology. This could include up-to-date versions of software, as well as upgrades to servers and computer processing power.

Achieve economies of scale – increase volume output or productivity with fewer people. Your cost per unit, project or product plummets.
Reduce spending on technology infrastructure. Maintain easy access to your information with minimal upfront spending. Pay as you go (weekly, quarterly or yearly), based on demand.
Globalize your workforce on the cheap. People worldwide can access the cloud, provided they have an Internet connection.
Streamline processes. Get more work done in less time with less people.
Reduce capital costs. There’s no need to spend big money on hardware, software or licensing fees.
Improve accessibility. You have access anytime, anywhere, making your life so much easier!
Monitor projects more effectively. Stay within budget and ahead of completion cycle times.
Less personnel training is needed. It takes fewer people to do more work on a cloud, with a minimal learning curve on hardware and software issues.
Minimize licensing new software. Stretch and grow without the need to buy expensive software licenses or programs.
Improve flexibility. You can change direction without serious “people” or “financial” issues at stake.



 References
1. http://en.wikipedia.org/wiki/Cloud_computing#Advantages
2. http://www.verio.com/resource-center/articles/cloud-computing-benefits/


<<Previous <<   || Index ||   >>Next >>


What is Cloud Computing?

Cloud Computing provides us a means by which we can access the applications as utilities, over the Internet. It allows us to create, configure, and customize applications online.

What is Cloud?
The term Cloud refers to a Network or Internet. In other words, we can say that Cloud is something, which is present at remote location. Cloud can provide services over network, i.e., on public networks or on private networks, i.e., WAN, LAN or VPN.

Applications such as e-mail, web conferencing, customer relationship management (CRM), all run in cloud.

What is Cloud Computing?
Cloud computing means on demand delivery of IT resources via the internet with pay-as-you-go pricing. It provides a solution of IT infrastructure in low cost. In the simplest terms, cloud computing means storing and accessing data and programs over the Internet instead of your computer's hard drive. The cloud is just a metaphor for the Internet. It goes back to the days of flowcharts and presentations that would represent the gigantic server-farm infrastructure of the Internet as nothing but a puffy, white cumulonimbus cloud, accepting connections and doling out information as it floats.

What is Cloud Computing

Why Cloud Computing?
Actually, Small as well as some large IT companies follows the traditional methods to provide the IT infrastructure. That means for any IT company, we need a Server Room that is the basic need of IT companies.

In that server room, there should be a database server, mail server, networking, firewalls, routers, modem, switches, QPS (Query Per Second means how much queries or load will be handled by the server) , configurable system, high net speed and the maintenance engineers.

To establish such IT infrastructure, we need to spend lots of money. To overcome all these problems and to reduce the IT infrastructure cost, Cloud Computing comes into existence.

Cloud Computing

Characteristics of Cloud Computing
The characteristics of cloud computing are given below:
1) Agility
The cloud works in the distributed computing environment. It shares resources among users and works very fast.

2) High availability and reliability
Availability of servers is high and more reliable, because chances of infrastructure failure are minimal.

3) High Scalability
Means "on-demand" provisioning of resources on a large scale, without having engineers for peak loads.

4) Multi-Sharing
With the help of cloud computing, multiple users and applications can work more efficiently with cost reductions by sharing common infrastructure.

5) Device and Location Independence
Cloud computing enables the users to access systems using a web browser regardless of their location or what device they use e.g. PC, mobile phone etc. As infrastructure is off-site (typically provided by a third-party) and accessed via the Internet, users can connect from anywhere.

6) Maintenance
Maintenance of cloud computing applications is easier, since they do not need to be installed on each user's computer and can be accessed from different places. So, it reduces the cost also.

7) Low Cost
By using cloud computing, the cost will be reduced because to take the services of cloud computing, IT company need not to set its own infrastructure and pay-as-per usage of resources.

8) Services in pay-per-use mode
Application Programming Interfaces (APIs) are provided to the users so that they can access services on the cloud by using these APIs and pay the charges as per the usage of services.


 References
1. http://en.wikipedia.org/wiki/Cloud_computing#Characteristics 
2. http://www.pcmag.com/article2/0,2817,2372163,00.asp



<<Previous <<   || Index ||   >>Next >>






Cloud Computing Tutorial

Cloud Computing provides us a means by which we can access the applications as utilities, over the internet. It allows us to create, configure, and customize the business applications online. Cloud Computing is a virtualization based technology that reduces the cost of IT infrastructure. It provides a solution of IT infrastructure in low cost.

In computer networking, cloud computing is computing that involves a large number of computers connected through a communication network such as the Internet, similar to utility computing. In science, cloud computing is a synonym for distributed computing over a network, and means the ability to run a program or application on many connected computers at the same time.

Cloud Computing Tutorial

Cloud Computing makes computer infrastructure and services available "on-need" basis. The computing infrastructure could include hard disk, development platform, database, computing power or complete software applications. To access these resources from the cloud vendors, organizations do not need to make any large scale capital expenditures. Organization need to "pay per use" i.e. organization need to pay only as much for the computing infrastructure as they use. The billing model of cloud computing is similar to the electricity payment that we do on the basis of usage. In the description below vendor is used for cloud computing service provide and organization is used for user of cloud computing services.
Cloud Computing

Cloud Computing Contents-
1. Introduction of Cloud Computing
2. Cloud Service Models
3. Cloud Deployment Models
4. Cloud Advanced Concepts
  • Cloud Computing Management
  • Cloud Computing Data Storage
  • Cloud Computing Virtualization
  • Cloud Computing Security
  • Cloud Computing Operation
  • Cloud Computing Applications
  • Cloud Computing Providers
  • Cloud Computing Challenges
  • Mobile Cloud Computing


References
1. http://en.wikipedia.org/wiki/Cloud_computing
2. http://thecloudtutorial.com/






<<Previous <<   || Index ||   >>Next >>






Writing Contract-First Web Services

This tutorial shows you how to write contract-first Web services, that is, developing web services that start with the XML Schema/WSDL contract first followed by the Java code second. Spring-WS focuses on this development style, and this tutorial will help you get started.

The most important thing when doing contract-first Web service development is to try and think in terms of XML. This means that Java-language concepts are of lesser importance. It is the XML that is sent across the wire, and you should focus on that. The fact that Java is used to implement the Web service is an implementation detail. An important detail, but a detail nonetheless.

In this tutorial, we will define a Web service that is created by a Human Resources department. Clients can send holiday request forms to this service to book a holiday.

Messages
In this section, we will focus on the actual XML messages that are sent to and from the Web service. We will start out by determining what these messages look like.
Holiday
In the scenario, we have to deal with holiday requests, so it makes sense to determine what a holiday looks like in XML:
<Holiday xmlns="http://mycompany.com/hr/schemas">
    <StartDate>2006-07-03</StartDate>
    <EndDate>2006-07-07</EndDate>
</Holiday>
A holiday consists of a start date and an end date.

Employee
There is also the notion of an employee in the scenario. Here is what it looks like in XML:
<Employee xmlns="http://mycompany.com/hr/schemas">
    <Number>42</Number>
    <FirstName>Arjen</FirstName>
    <LastName>Poutsma</LastName>
</Employee>

HolidayRequest
Both the holiday and employee element can be put in a <HolidayRequest/>:
<HolidayRequest xmlns="http://mycompany.com/hr/schemas">
    <Holiday>
        <StartDate>2006-07-03</StartDate>
        <EndDate>2006-07-07</EndDate>
    </Holiday>
    <Employee>
        <Number>42</Number>
        <FirstName>Arjen</FirstName>
        <LastName>Poutsma</LastName>
    </Employee>
</HolidayRequest>

The order of the two elements does not matter: <Employee/> could have been the first element just as well. What is important is that all of the data is there. In fact, the data is the only thing that is important: we are taking a data-driven approach.

Data Contract
Now that we have seen some examples of the XML data that we will use, it makes sense to formalize this into a schema. This data contract defines the message format we accept. There are four different ways of defining such a contract for XML:
  • DTDs
  • XML Schema (XSD)
  • RELAX NG
  • Schematron
DTDs have limited namespace support, so they are not suitable for Web services. Relax NG and Schematron certainly are easier than XML Schema. Unfortunately, they are not so widely supported across platforms. We will use XML Schema.

By far the easiest way to create an XSD is to infer it from sample documents. Any good XML editor or Java IDE offers this functionality. Basically, these tools use some sample XML documents, and generate a schema from it that validates them all. The end result certainly needs to be polished up, but it's a great starting point.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:hr="http://mycompany.com/hr/schemas"
        elementFormDefault="qualified"
        targetNamespace="http://mycompany.com/hr/schemas">
    <xs:element name="HolidayRequest">
        <xs:complexType>
            <xs:all>
                <xs:element name="Holiday" type="hr:HolidayType"/>                       (1)
                <xs:element name="Employee" type="hr:EmployeeType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="HolidayType">
        <xs:sequence>
            <xs:element name="StartDate" type="xs:date"/>
            <xs:element name="EndDate" type="xs:date"/>                                  (2)
        </xs:sequence>                                                                   (2)
    </xs:complexType>
    <xs:complexType name="EmployeeType">
        <xs:sequence>
            <xs:element name="Number" type="xs:integer"/>
            <xs:element name="FirstName" type="xs:string"/>
            <xs:element name="LastName" type="xs:string"/>                               (3)
        </xs:sequence>                                                                   (3)
    </xs:complexType>
</xs:schema>


1. all tells the XML parser that the order of <Holiday/> and <Employee/> is not significant.
2. We use the xsd:date data type, which consist of a year, month, and day, for <StartDate/> and <EndDate/>.
3. xsd:string is used for the first and last name.

We store this file as hr.xsd.

Service contract
A service contract is generally expressed as a WSDL file. Note that in Spring-WS, writing the WSDL by hand is not required. Based on the XSD and some conventions, Spring-WS can create the WSDL for you.

We start our WSDL with the standard preamble, and by importing our existing XSD. To separate the schema from the definition, we will use a separate namespace for the WSDL definitions: http://mycompany.com/hr/definitions.

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:schema="http://mycompany.com/hr/schemas"
                  xmlns:tns="http://mycompany.com/hr/definitions"
                  targetNamespace="http://mycompany.com/hr/definitions">
    <wsdl:types>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:import namespace="http://mycompany.com/hr/schemas" schemaLocation="hr.xsd"/>
        </xsd:schema>
    </wsdl:types>

Next, we add our messages based on the written schema types. We only have one message: one with the <HolidayRequest/> we put in the schema:

<wsdl:message name="HolidayRequest">
        <wsdl:part element="schema:HolidayRequest" name="HolidayRequest"/>
    </wsdl:message>
We add the message to a port type as an operation:
<wsdl:portType name="HumanResource">
        <wsdl:operation name="Holiday">
            <wsdl:input message="tns:HolidayRequest" name="HolidayRequest"/>
        </wsdl:operation>
    </wsdl:portType>

That finished the abstract part of the WSDL (the interface, as it were), and leaves the concrete part. The concrete part consists of a binding, which tells the client how to invoke the operations you've just defined; and a service, which tells it where to invoke it.

Adding a concrete part is pretty standard: just refer to the abstract part you defined previously, make sure you use document/literal for the soap:binding elements (rpc/encoded is deprecated), pick a soapAction for the operation (in this case http://mycompany.com/RequestHoliday, but any URI will do), and determine the location URL where you want request to come in (in this case http://mycompany.com/humanresources):

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:schema="http://mycompany.com/hr/schemas"
                  xmlns:tns="http://mycompany.com/hr/definitions"
                  targetNamespace="http://mycompany.com/hr/definitions">
    <wsdl:types>
        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:import namespace="http://mycompany.com/hr/schemas"                      (1)
                schemaLocation="hr.xsd"/>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="HolidayRequest">                                                 (2)
        <wsdl:part element="schema:HolidayRequest" name="HolidayRequest"/>               (3)
    </wsdl:message>
    <wsdl:portType name="HumanResource">                                                 (4)
        <wsdl:operation name="Holiday">
            <wsdl:input message="tns:HolidayRequest" name="HolidayRequest"/>             (2)
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="HumanResourceBinding" type="tns:HumanResource">                  (4)(5)
        <soap:binding style="document"                                                   (6)
            transport="http://schemas.xmlsoap.org/soap/http"/>                           (7)
        <wsdl:operation name="Holiday">
            <soap:operation soapAction="http://mycompany.com/RequestHoliday"/>           (8)
            <wsdl:input name="HolidayRequest">
                <soap:body use="literal"/>                                               (6)
            </wsdl:input>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="HumanResourceService">
        <wsdl:port binding="tns:HumanResourceBinding" name="HumanResourcePort">          (5)
            <soap:address location="http://localhost:8080/holidayService/"/>             (9)
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

1. We import the schema "Data Contract".
2. We define the HolidayRequest message, which gets used in the portType.
3. The HolidayRequest type is defined in the schema.
4. We define the HumanResource port type, which gets used in the binding.
5. We define the HumanResourceBinding binding, which gets used in the port.
6. We use a document/literal style.
7. The literal http://schemas.xmlsoap.org/soap/http signifies a HTTP transport.
8. The soapAction attribute signifies the SOAPAction HTTP header that will be sent with every request.
9. The http://localhost:8080/holidayService/ address is the URL where the Web service can be invoked.

This is the final WSDL. We will describe how to implement the resulting schema and WSDL in the next section.

Implementing the Endpoint
In Spring-WS, you will implement Endpoints to handle incoming XML messages. An endpoint is typically created by annotating a class with the @Endpoint annotation. In this endpoint class, you will create one or more methods that handle incoming request. The method signatures can be quite flexible: you can include just about any sort of parameter type related to the incoming XML message.
package com.mycompany.hr.ws;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;

import com.mycompany.hr.service.HumanResourceService;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.Namespace;
import org.jdom.xpath.XPath;

@Endpoint                                                                                (1)
public class HolidayEndpoint {

  private static final String NAMESPACE_URI = "http://mycompany.com/hr/schemas";

  private XPath startDateExpression;

  private XPath endDateExpression;

  private XPath nameExpression;

  private HumanResourceService humanResourceService;

  @Autowired
  public HolidayEndpoint(HumanResourceService humanResourceService)                      (2)
      throws JDOMException {
    this.humanResourceService = humanResourceService;

    Namespace namespace = Namespace.getNamespace("hr", NAMESPACE_URI);

    startDateExpression = XPath.newInstance("//hr:StartDate");
    startDateExpression.addNamespace(namespace);

    endDateExpression = XPath.newInstance("//hr:EndDate");
    endDateExpression.addNamespace(namespace);

    nameExpression = XPath.newInstance("concat(//hr:FirstName,' ',//hr:LastName)");
    nameExpression.addNamespace(namespace);
  }

  @PayloadRoot(namespace = NAMESPACE_URI, localPart = "HolidayRequest")                  (3)
  public void handleHolidayRequest(@RequestPayload Element holidayRequest)               (4)
      throws Exception {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    Date startDate = dateFormat.parse(startDateExpression.valueOf(holidayRequest));
    Date endDate = dateFormat.parse(endDateExpression.valueOf(holidayRequest));
    String name = nameExpression.valueOf(holidayRequest);

    humanResourceService.bookHoliday(startDate, endDate, name);
  }

}
1. The HolidayEndpoint is annotated with @Endpoint. This marks the class as a special sort of @Component, suitable for handling XML messages in Spring-WS, and also making it eligible for suitable for component scanning.

2. The HolidayEndpoint requires the HumanResourceService business service to operate, so we inject the dependency via the constructor and annotate it with @Autowired. Next, we set up XPath expressions using the JDOM API. There are three expressions: //hr:StartDate for extracting the <l;StartDate> text value, //hr:EndDate for extracting the end date and concat(//hr:FirstName,' ',//hr:LastName) for extracting and concatenating the names of the employee.

3. The @PayloadRoot annotation tells Spring-WS that the handleHolidayRequest method is suitable for handling XML messages. The sort of message that this method can handle is indicated by the annotation values, in this case, it can handle XML elements that have the HolidayRequest local part and the http://mycompany.com/hr/schemas namespace. More information about mapping messages to endpoints is provided in the next section.

4. The handleHolidayRequest(..) method is the main handling method method, which gets passed with the <HolidayRequest/> element from the incoming XML message. The @RequestPayload annotation indicates that the holidayRequest parameter should be mapped to the payload of the request message. We use the XPath expressions to extract the string values from the XML messages, and convert these values to Date objects using a SimpleDateFormat. With these values, we invoke a method on the business service. Typically, this will result in a database transaction being started, and some records being altered in the database. Finally, we define a void return type, which indicates to Spring-WS that we do not want to send a response message. If we wanted a response message, we could have returned a JDOM Element that represents the payload of the response message.


Here is how we would configure these classes in our spring-ws-servlet.xml Spring XML configuration file, by using component scanning. We also instruct Spring-WS to use annotation-driven endpoints, with the <sws:annotation-driven> element.
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:sws="http://www.springframework.org/schema/web-services"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

  <context:component-scan base-package="com.mycompany.hr"/>

  <sws:annotation-driven/>

</beans>

Routing the Message to the Endpoint
As part of writing the endpoint, we also used the @PayloadRoot annotation to indicate which sort of messages can be handled by the handleHolidayRequest method. In Spring-WS, this process is the responsibility of an EndpointMapping. Here we route messages based on their content, by using a PayloadRootAnnotationMethodEndpointMapping. The annotation used above:
@PayloadRoot(namespace = "http://mycompany.com/hr/schemas", localPart = "HolidayRequest")
basically means that whenever an XML message is received with the namespace http://mycompany.com/hr/schemas and the HolidayRequest local name, it will be routed to the handleHolidayRequest method. By using the element in our configuration, we enable the detection of the @PayloadRoot annotations. It is possible (and quite common) to have multiple, related handling methods in an endpoint, each of them handling different XML messages.

Providing the Service and Stub implementation
Now that we have the Endpoint, we need HumanResourceService and its implementation for use by HolidayEndpoint.


package com.mycompany.hr.service;

import java.util.Date;

public interface HumanResourceService {
    void bookHoliday(Date startDate, Date endDate, String name);
}

For tutorial purposes, we will use a simple stub implementation of the HumanResourceService.
package com.mycompany.hr.service;

import java.util.Date;

import org.springframework.stereotype.Service;

@Service                                                                                 (1)
public class StubHumanResourceService implements HumanResourceService {
    public void bookHoliday(Date startDate, Date endDate, String name) {
        System.out.println("Booking holiday for [" + startDate + "-" + endDate + "] for [" + name + "] ");
    }
}
 The StubHumanResourceService is annotated with @Service. This marks the class as a business facade, which makes this a candidate for injection by @Autowired in HolidayEndpoint.





<<Previous <<   || Index ||   >>Next >>