正文

Guidance of SOAP2009-04-12 17:23:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/xman/42118.html

分享到:

What is a Web Service?

Web Services Standards(XML -based)

-SOAP(Simple Object Access Protocol)

-WSDL(Web Service Description Language)

-UDDI(Universal Description,Discovery,Integration)

-WS-I(Integration),WS-Policy,WS-Security,etc.

http://searchwebservices.techtarget.com/searchWebServices/downloads/what_is_soap.swf

What is SOAP

It is a simple Protocol that allows you to Access an Object across th Net.

When software developers create systems,they rely on calling procedures to provide needed functionality.

A collection of related procedures are packaged into an object.

Objects can be created in such a way that they can be re-used by different systems and different developers.

However,objects are typically platform specific.

An object created on one platform is not always easily accessible to software written for other platforms.

Furthermore,calling methods from objects distributed across the Internet is difficult.

Current distributed object technologies require the use of special ports to transmit their data.

However,most corporate firewalls prevent the use of all ports except 80,the default port for HTTP.

Most system adminitrators fear opening other ports could pose a potential security problem.

What is needed is…

1.A platform-independent way to call methods located on diverse distributed systems.

2.A firewall-friendly way to make remote procedure calls over the internet.

(And it would be nice if it was lightweight and easy to understand.)

SOAP to the rescue

Able to cross platform boundries like a speeding bullet.

(SOAP uses XML to be platform-agnostic)

Able to leap through firewalls in a single bound.

(XML Documents can easily be transported via HTTP through firewalls without security risks.)

What SOAP does

Messages are (typically) sent in a familiar Request/Response fashion.

SOAP defines an XML structure to call a method and pass that mehod parameters.

SOAP also defines an XML structure to return values that were requested.

SOAP defines an XML structure to return error values (faults) if the service provider can not execute the requested method.

客户端通过SOAP传递XML structure参数给服务器端指定的Method,服务器端调用Method后返回相应的XML structure结果给客户端。它实际上市利用HTTPXML来完成远程调用(Remote Procedure).

What SOAP doesn’t do

The SOAP specification does not define how a message ,once received,will create an instance of an object and excute the method.

Again,implementation details are left to the software developer or a third party software vendor.

Software vendors are already creating this “plumbing” so software developers can concentrate on implementing the business rules.

Creating a request

In this example,”My software” will call the “AddTwoNumbers” function that resides on a server across the Internet.

通过互联网远程调用服务器端的函数。

”My software” composes a SOAP message and will use HTTP to actually send it.

The message looks like this…

<?xml version="1.0">
<soap:Envelope xmlns:soap="url:schemas.xmlsoap-org:soap.v1">
  <soap:Body >
    <AddTwoNumbers>
      <FirstNumber>5</FirstNumber>
      <SecondNumber>3</SecondNumber>
    </AddTwoNumbers>
  </soap:Body>
</soap:Envelope>

Imbedded within the SOAP Envelope tags,there is a tag for the method name and tags for the parameters.

Between the opening and closing parameter tags are the actual values that will be sent to the method.

Creating a Response

The message is received on the remote server.Once received, the object is created and the method is called ,sending along two parameters.

Once the method is finished processing,it creates a SOAP message to send the result back to “My Software”.

The message looks like this…

<?xml version="1.0">

<soap:Envelope xmlns:soap="url:schemas.xmlsoap-org:soap.v1">

<soap:Body>

    < AddTwoNumbersResponse>

      <Value>8</Value>

    </AddTwoNumbersResponse>

  </soap:Body>

</soap: Envelope >

The message contains the name of the response,and the value of the response.

This message is returned to “My software” where it is processed.

What is SOAP

http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci214295,00.html

SOAP (Simple Object Access Protocol) is a way for a program running in one kind of operating system (such as Windows 2000) to communicate with a progam in the same or another kind of an operating system (such as Linux) by using the World Wide Web's Hypertext Transfer Protocol (HTTP)and its EXtensible Markup Language (XML) as the mechanisms for information exchange. Since Web protocols are installed and available for use by all major(主要) operating system platforms, HTTP and XML provide an already at-hand solution to the problem of how programs running under different operating systems in a network can communicate with each other. SOAP specifies exactly how to encode(编码) an HTTP header and an XML file so that a program in one computer can call a program in another computer and pass it information. It also specifies how the called program can return a response.

SOAP was developed by Microsoft, DevelopMentor, and Userland Software and has been proposed(被提议) as a standard interface to the Internet Engineering Task Force (IETF). It is somewhat similar to the Internet Inter-ORB Protocol (IIOP), a protocol that is part of the Common Object Request Broker Architecture (CORBA). Sun Microsystems' Remote Method Invocation(请求) (RMI) is a similar client/server interprogram protocol between programs written in Java.

An advantage of SOAP is that program calls are much more likely to get through firewall servers that screen out(筛选出) requests other than those for known applications (through the designated port mechanism). Since HTTP requests are usually allowed through firewalls, programs using SOAP to communicate can be sure that they can communicate with programs anywhere.

阅读(1589) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册