`
C_J
  • 浏览: 127873 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

What's Web Service in 2009

阅读更多

What are Web Services?

  • Web services are application components
  • Web services communicate using open protocols
  • Web services are self-contained and self-describing
  • Web services can be discovered using UDDI
  • Web services can be used by other applications
  • XML is the basis for Web services

How Does it Work?

The basic Web services platform is XML + HTTP.

XML provides a language which can be used between different platforms and programming languages and still express complex messages and functions.

The HTTP protocol is the most used Internet protocol.

Web services platform elements:

  • SOAP (Simple Object Access Protocol)
  • UDDI (Universal Description, Discovery and Integration)
  • WSDL (Web Services Description Language)

 

Interoperability has Highest Priority

When all major platforms could access the Web using Web browsers, different platforms could interact. For these platforms to work together, Web-applications were developed.

Web-applications are simple applications that run on the web. These are built around the Web browser standards and can be used by any browser on any platform.


Web Services take Web-applications to the Next Level

By using Web services, your application can publish its function or message to the rest of the world.

Web services use XML to code and to decode data, and SOAP to transport it (using open protocols).

With Web services, your accounting department's Win 2k server's billing system can connect with your IT supplier's UNIX server.


Web Services have Two Types of Uses

Reusable application-components.

There are things applications need very often. So why make these over and over again?

Web services can offer application-components like: currency conversion, weather reports, or even language translation as services.

Connect existing software.

Web services can help to solve the interoperability problem by giving different applications a way to link their data.

With Web services you can exchange data between different applications and different platforms.

 

What is SOAP?

  • SOAP stands for Simple Object Access Protocol
  • SOAP is a communication protocol
  • SOAP is for communication between applications
  • SOAP is a format for sending messages
  • SOAP communicates via Internet
  • SOAP is platform independent
  • SOAP is language independent
  • SOAP is based on XML
  • SOAP is simple and extensible
  • SOAP allows you to get around firewalls
  • SOAP is a W3C recommendation

Why SOAP?

It is important for application development to allow Internet communication between programs.

Today's applications communicate using Remote Procedure Calls (RPC) between objects like DCOM and CORBA, but HTTP was not designed for this. RPC represents a compatibility and security problem; firewalls and proxy servers will normally block this kind of traffic.

A better way to communicate between applications is over HTTP, because HTTP is supported by all Internet browsers and servers. SOAP was created to accomplish this.

SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.

 

 

Syntax Rules

Here are some important syntax rules:

  • A SOAP message MUST be encoded using XML
  • A SOAP message MUST use the SOAP Envelope namespace
  • A SOAP message MUST use the SOAP Encoding namespace
  • A SOAP message must NOT contain a DTD reference
  • A SOAP message must NOT contain XML Processing Instructions

Skeleton SOAP Message

 

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Header>
...
</soap:Header>

<soap:Body>
...
  <soap:Fault>
  ...
  </soap:Fault>
</soap:Body>

</soap:Envelope>

 

What You Should Already Know

Before you continue you should have a basic understanding of the following:

  • XML
  • XML Namespaces
  • XML Schema

If you want to study these subjects first, find the tutorials on our Home page.


What is WSDL?

  • WSDL stands for Web Services Description Language
  • WSDL is written in XML
  • WSDL is an XML document
  • WSDL is used to describe Web services
  • WSDL is also used to locate Web services
  • WSDL is a W3C recommendation

WSDL Describes Web Services

WSDL stands for Web Services Description Language.

WSDL is a document written in XML. The document describes a Web service. It specifies the location of the service and the operations (or methods) the service exposes.

 

 

 

The WSDL Document Structure

A WSDL document describes a web service using these major elements:

 

Element Defines
<types> The data types used by the web service
<message> The messages used by the web service
<portType> The operations performed by the web service
<binding> The communication protocols used by the web service

The main structure of a WSDL document looks like this:

 

<definitions>

<types>
  definition of types........
</types>

<message>
  definition of a message....
</message>

<portType>
  definition of a port.......
</portType>

<binding>
  definition of a binding....
</binding>

</definitions>

A WSDL document can also contain other elements, like extension elements, and a service element that makes it possible to group together the definitions of several web services in one single WSDL document.


WSDL Ports

The <portType> element is the most important WSDL element.

It describes a web service, the operations that can be performed, and the messages that are involved.

The <portType> element can be compared to a function library (or a module, or a class) in a traditional programming language.


WSDL Messages

The <message> element defines the data elements of an operation.

Each message can consist of one or more parts. The parts can be compared to the parameters of a function call in a traditional programming language.


WSDL Types

The <types> element defines the data types that are used by the web service.

For maximum platform neutrality, WSDL uses XML Schema syntax to define data types.


WSDL Bindings

The <binding> element defines the message format and protocol details for each port.


WSDL Example

This is a simplified fraction of a WSDL document:

 

<message name="getTermRequest">
  <part name="term" type="xs:string"/>
</message>

<message name="getTermResponse">
  <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
  <operation name="getTerm">
    <input message="getTermRequest"/>
    <output message="getTermResponse"/>
  </operation>
</portType>

In this example the <portType> element defines "glossaryTerms" as the name of a port, and "getTerm" as the name of an operation.

The "getTerm" operation has an input message called "getTermRequest" and an output message called "getTermResponse".

The <message> elements define the parts of each message and the associated data types.

Compared to traditional programming, glossaryTerms is a function library, "getTerm" is a function with "getTermRequest" as the input parameter, and getTermResponse as the return parameter.

分享到:
评论

相关推荐

    Amazon Web Services in Action(Manning,2015)

    What's Inside Overview of cloud concepts and patterns Deploy applications on AWS Integrate Amazon's pre-built services Manage servers on EC2 for cost-effectiveness About the Reader Written for ...

    Web.Performance.in.Action.Building.Faster.Web.Pages.epub

    Due to these hard realities, it's more important than ever that your website loads quickly, lest you alienate your visitors before they ever get a chance to see what your site has to offer. ...

    building restful web services with spring 5 2e

    In today’s connected world, APIs have taken a central role on the web. APIs provide the fabric through which systems interact, and REST has become synonymous with APIs.The depth, breadth, and ease ...

    Learning ServiceNow: Administration and development on the Now platform 2nd epub

    Learn to leverage ServiceNow’s capabilities for improved IT automation by following step-by-step, practical instructions Build core administration, development, and maintenance skills with IT service...

    Oracle Solaris 9 -What’s New in the Solaris 9 8/03 Operating Env

    2. **服务管理框架**:这一版本引入了服务管理框架(Service Management Framework, SMF),它提供了一种更现代、灵活的服务配置和管理系统,允许管理员更轻松地管理和控制操作系统服务。 3. **Solaris Web Start ...

    Progressive Web Apps

    原版pdf Progressive Web Apps ...What's Inside Improved caching with Service Workers Using manifest files and HTML markup Push notifications Offline-first web designs Techniques for data synchronization

    docker on amazon web services

    Amazon Web Services (AWS) is a leader in public cloud computing, and was the first to offer a managed container platform in the form of the Elastic Container Service (ECS). Docker on Amazon Web ...

    PHP Web 2.0 Mashup Projects.pdf

    Web and present it in a single application. All the mashup applications used in the book are built upon free tools and are thoroughly explained. You will find all the source code used to build the ...

    RESTful Web Services.rar

    a simple set of principles that every day developers can use to connect applications in a style native to the Web. Table of Contents Foreword........ . . . xi Preface........ . . . xiii 1. ...

    Python Web Scraping Cookbook: Over 90 proven recipes to get you scraping with Py

    Right from extracting data from the websites to writing a sophisticated web crawler, the book's independent recipes will be a godsend on the job. This book covers Python libraries, requests, and ...

    iOS Apprentice 4 StoreSearch v4.1

    The StoreSearch app ...what’s the harm in writing another one? Apple has made a web service available for searching the entire iTunes store and you’ll be using that to learn about networking.

    Node.js Web Development

    Node.js Web Development: Build secure and high performance web applications with Node.js 10 Node.js is a server-side JavaScript platform using an event-driven, non-blocking I/O model allowing users to...

    MySQL.and.Perl.for.the.Web

    Both MySQL and Perl are well documented in several tutorials, but in-depth coverage of Web development using the combination of the two is rare. MySQL and Perl for the Web zeroes in on this ...

    Mastering Full-Stack React Web Development

    This book will get you up to speed with one of the latest strategies to meet the demands of today's dynamic and data-intensive web. Combining detailed insights and guidance with practical and ...

    Manning.Spring.in.Action.4th.Edition.2014.11.epub

    1.4. What’s new in Spring 1.4.1. What was new in Spring 3.1? 1.4.2. What was new in Spring 3.2? 1.4.3. What’s new in Spring 4.0? 1.5. Summary Chapter 2. Wiring beans 2.1. Exploring Spring’s ...

    Deliver.Audacious.Web.Apps.with.Ember2

    It's time for web development to be fun again, time to write engaging and attractive apps--fast--in this brisk tutorial. Build a complete user interface in a few lines of code, create reusable web ...

    Microsoft .NET Framework 3.5 Service Pack 1

    有关更多信息,请参见 What’s New in ASP.NET and Web Development(ASP.NET 和 Web 开发中的新增功能)。 对公共语言运行时的核心改进包括:改进了 .NET Framework 本机映像的布局、选择不再对完全受信任的程序集...

Global site tag (gtag.js) - Google Analytics