当前位置: 代码迷 >> Web前端 >> WebService定义及SOAP通讯方式
  详细解决方案

WebService定义及SOAP通讯方式

热度:246   发布时间:2012-11-01 11:11:32.0
WebService定义及SOAP通信方式

W3C对WebService的定义:

?

A Web service is a software system identified by a URI whose public interfaces and bindings are defined and

described using XML (specifically WSDL). Its definition can be discovered by other software systems. These

systems may then interact with the web service in a manner prescribed by its definition, using XML-based

messages conveyed by Internet protocols.

?

SOAP-Based Communication Style:

SOAP Message Style有两种类型:Document, RPC. SOAP Message Style在WSDL文档中被定义为:SOAP

Binding.而SOAP Binding针对SOAP Body可以采用Encoded(消息被加密)或Literal(原文)方式。例如:

<!-- Specifies the SOAP Binding for Verify Address Process. -->
<wsdl:binding name="AddressVerifyProcessImplServiceSoapBinding"
	type="tns:AddressVerifyProcess">
	<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
		<wsdl:operation name="verifyAddress">
			<soap:operation soapAction="" style="document" />
			<wsdl:input name="verifyAddress">
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output name="verifyAddressResponse">
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
</wsdl:binding>

(1) Document Style

即处理XMLMessage时采用XML Scheme进行约束。

(2) RPC Style

即处理XMLMessage时没采用任何XML Scheme进行约束,因为这中情况下SOAP Body包含方法的XML描述,

同时通过序列化将方法参数序列化至SOAP Message,同时也可以被任何WebService实现通过反序列化获得

Message。

?

?

  相关解决方案