Using AJAX and Wsrf::lite in combination

Source: Internet
Author: User
Tags command line current time resource web services xslt

Before you start

About this series

This tutorial is a follow-up to the top two tutorials on wsrf::lite. The first tutorial, "Building ws-resources with Wsrf::lite", describes WSRF, ws-addressing standards, and Wsrf::lite (which is a WSRF implemented in Perl). It demonstrates how to construct a ws-resource of an analog counter using wsrf::lite, and how to construct a client to query or update counter Ws-resource.

The second tutorial "build secure Ws-resources with Wsrf::lite and ws-security" uses the counter Ws-resource example in the first tutorial to illustrate how to make this example more secure. In this paper, two methods are used: one is to use Transport Layer Security (Transport-level, TLS), and the other is to create a digital signature message using Ws-security.

About this tutorial

This tutorial uses the counter Ws-resource example in "Building ws-resources using Wsrf::lite", where you will learn how to query and update the counter using a Web browser. The article first briefly reviews the WSRF, Wsrf::lite, and counter Ws-resource, and then describes how to use HTTP access Ws-resources in Wsrf::lite, followed by an introduction to XSLT, explaining how to use the XSLT to put the counter WS -Resource XML resourcepropertydocument is converted to HTML so that it is displayed in the browser. Finally, it describes how to use JavaScript code to automatically update the browser page and how to modify the value of the counter ws-resource.

Prerequisite

You should be familiar with Perl, WSRF, and Wsrf::lite. How to be unfamiliar with wsrf::lite or WSRF, it is recommended that you read the first tutorial of a series of articles "Building ws-resources using Wsrf::lite". But you don't have to read the second tutorial "build secure Ws-resources with Wsrf::lite and ws-security" because this tutorial looks at security. XSLT, CSS, and JavaScript encodings are described and discussed, but you may find it more useful to have a more detailed background (including some tutorials) in reference resources.

System Requirements

To run the examples in this tutorial, you need to run linux® and Wsrf::lite V0.8.2 (or later) on your computer, and you must also install the Perl module xml::canonicalizexml. The module is not needed to run wsrf::lite, but it can support access using Ajax, which is one of the key points of this tutorial. You need to use Mozilla Firefox or windows®internet explorer® to query and update the sample counter Ws-resource used in this article. In addition, you will need to use the HTTP client command line, such as curl or wget.

WSRF and Wsrf::lite

This section briefly reviews WSRF and Wsrf::lite. See Resources for more detailed information. If you are familiar with wsrf::lite, or have just learned the previous tutorial, "Build ws-resources with Wsrf::lite," You can skip this section and read the next section directly.

WEB Services Resource Framework

WSRF is a set of OASIS standards for manipulating stateful resources through WEB service interfaces. An important concept in WSRF is Ws-resource, which consists of a resource and a Web service through which the Web services can access its resources. Associated with each ws-resource is a set of attributes, called resourceproperties, that can be queried and modified by a set of actions defined by WSRF.

WSRF also defines some standard resourceproperties-such as the current time that Ws-resource can have, so that when the customer queries Ws-resource, the Ws-resource resourceproperties is identified in the When you have a specific set of values. The complete set of resourceproperties, called RESOURCEPROPERTYDOCUMENT,WSRF, defines a (getresourcepropertydocument) operation to obtain a complete Resourcepropertydocument, another operation (putresourcepropertydocument) is defined to use the new resourcepropertydocument instead of ws-resource existing Resourcepropertydocument so that the client can update ws-resource.

Ws-resource can be long-lasting or temporary. To support the temporary nature of the Ws-resource, WSRF defines a resourceproperty named Terminationtime. The customer can change this resourceproperty to control the lifetime of the Ws-resource, and can also use the Destroy operation to request immediate termination of Ws-resource.

WSRF is useful because it provides a standard way to handle entities with some related states. This approach allows the reuse of client and server code and increases the likelihood of interoperability. The standard set of WSRF includes:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.