SoapExtension.ProcessMessage(SoapMessage) 方法


当在派生类中被重写时,允许 SOAP 扩展接收要在每个 SoapMessage 中处理的 SoapMessageStageWhen overridden in a derived class, allows a SOAP extension to receive a SoapMessage to process at each SoapMessageStage.

 abstract void ProcessMessage(System::Web::Services::Protocols::SoapMessage ^ message);
public abstract void ProcessMessage (System.Web.Services.Protocols.SoapMessage message);
abstract member ProcessMessage : System.Web.Services.Protocols.SoapMessage -> unit
Public MustOverride Sub ProcessMessage (message As SoapMessage)



要处理的 SoapMessageThe SoapMessage to process.


下面的示例是ProcessMessageSOAP 请求和 SOAP 响应的 SOAP 扩展的部分。The following example is the ProcessMessage portion of a SOAP extension that logs SOAP requests and SOAP responses. 通过日志记录SoapMessageAfterSerialize SoapMessageStage,SOAP 扩展访问Stream以通过网络发送。By logging the SoapMessage at the AfterSerializeSoapMessageStage, the SOAP extension accesses the Stream to be sent over the wire. 如果 SOAP 扩展会应用于 XML Web 服务方法创建使用 ASP.NET,则Stream包含来自 XML Web 服务方法的 SOAP 响应。If the SOAP extension is applied to an XML Web service method created using ASP.NET, then the Stream contains the SOAP response from the XML Web service method. 如果 SOAP 扩展应用于 XML Web 服务客户端,Stream包含对 XML Web 服务方法的 SOAP 请求。If the SOAP extension is applied to an XML Web service client, the Stream contains the SOAP request to an XML Web service method.

经典 SoapExtension.ProcessMessage 示例 #1Classic SoapExtension.ProcessMessage Example#1


ProcessMessage 在所有调用SoapMessageStage应用于使用 ASP.NET 和其客户端创建这两个 XML Web services 的 SOAP 扩展的阶段。ProcessMessage is called at all SoapMessageStage stages for SOAP extensions applied to both XML Web services created using ASP.NET and their clients. 在每个SoapMessageStage,从派生类的实例SoapMessage传递给ProcessMessageAt each SoapMessageStage, an instance of a class deriving from SoapMessage is passed to ProcessMessage. 如果 SOAP 扩展是 XML Web 服务客户端上运行,则SoapClientMessage对象传递给ProcessMessage; 否则为SoapServerMessage传入的对象。If the SOAP extension is running on the XML Web service client, then a SoapClientMessage object is passed into ProcessMessage; otherwise a SoapServerMessage object is passed in.