Web Service的研究
- - CSDN博客系统运维推荐文章SOA和Web Service. 首先明白SOA和Web Service的关系:. * SOA面向服务架构,用于大型分布式系统的一个概念;. * Web Service是实现SOA的方式之一,不是所有的SOA都是基于Web service的;. * 但Webservice确实为最主流的SOA实现方式,有的人甚至把SOA等同于Webservice.
<?xml version="1.0" encoding="utf-8" ?>
<definitions name="CustomerService"
targetNamespace="http://soa-in-practice.com/wsdl"
xmlns:tns="http://soa-in-practice.com/wsdl"
xmlns:xsd1="http://soa-in-practice.com/xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema
targetNamespace="http://soa-in-practice.com/xsd"
xmlns="http://soa-in-practice.com/xsd">
<xsd:element name="getCustomerAddress">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="customerID" type="xsd:long"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getCustomerAddressResponse" type="Address"/>
<xsd:complexType name="Address">
<xsd:sequence>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="zipCode" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<message name="getCustomerAddressInput">
<part name="params" element="xsd1:getCustomerAddress"/>
</message>
<message name="getCustomerAddressOutput">
<part name="params" element="xsd1:getCustomerAddressResponse"/>
</message>
<portType name="CustomerInterface" >
<operation name="getCustomerAddress">
<input message="tns:getCustomerAddressInput" />
<output message="tns:getCustomerAddressOutput" />
</operation>
</portType>
<binding name="CustomerSOAPBinding"
type="tns:CustomerInterface" >
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="getCustomerAddress">
<soap:operation
soapAction="http://soa-in-practice.com/getCustomerAddress" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="CustomerService" >
<port name="CustomerPort"
binding="tns:CustomerSOAPBinding">
<soap:address
location="http://soa-in-practice.com/customer11"/>
</port>
</service>
</definitions><?xml version='1.0' ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
...
</soap:Header>
<soap:Body>
<getCustomerAddress xmlns="http://soa-in-practice.com/xsd">
<customerID>12345678</customerID>
</getCustomerAddress >
</soap:Body>
</soap:Envelope><?xml version='1.0' ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
...
</soap:Header>
<soap:Body>
<getCustomerAddressResponse xmlns="http://soa-in-practice.com/xsd">
<address>
<street>Gaussstr. 29</street>
<city>Braunschweig</city>
<zipCode>D-38106</zipCode>
</address>
</getCustomerAddressResponse>
</soap:Body>
</soap:Envelope> GET /path/file.html HTTP/1.0
From: [email protected]
User-Agent: HTTPTool/1.0
[blank line here] HTTP Response Example HTTP/1.0 200 OK
Date: Fri, 31 Dec 1999 23:59:59 GMT
Content-Type: text/html
Content-Length: 1354
<html>
<body>
<h1>Happy New Millennium!</h1>
(more file contents)
.
.
.
</body>
</html>