SOAP响应消息 [英] SOAP response message

查看:116
本文介绍了SOAP响应消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在visual studio中获取SOAP响应消息



TCP / ip监控?

解决方案

< blockquote>

Quote:

在包含SOAP客户端项目文件的同一文件夹中保存以下代码,名称为SqlSoapTracer.cs。

在Solution Explorer窗口中,执行以下步骤:

按名称选择项目,右键单击并指向添加,然后选择添加现有项目。

在添加现有项对话框中,浏览并从步骤1中保存它的位置中选择SqlSoapTracer.cs文件。

选择显示所有文件并展开Web引用节点并选择Reference.cs文件。

在代码编辑器窗口中,通过在那里找到Web方法的入口点来更新Reference.cs文件。要在Web方法在客户端代码中执行时添加SOAP跟踪支持,请在要跟踪的每个Web方法的入口点之前直接在Reference.cs代码中添加以下snoopattribute()调用,如以下代码行所示。



  1  
[System.Web.Services。 Protocols.SoapRpcMethodAttribute( urn:ContactService#login,RequestNamespace = urn:ContactService,ResponseNamespace = urn:ContactService)]
2
[ return :System.Xml.Serialization.SoapElementAttribute( token)]
3
[snoopattribute()]
4
public string login( string user,< span class =code-keyword> string pass,login_options login_options){ object [] results = this .Invoke( login new object [] {user,pass,login_options}); return (( string )(结果[ 0 ])); }







这会注册一个SOAP扩展,在执行这些Web方法时调用这些Web方法的SOAP跟踪。





http:// forums .asp.net / t / 1827540.aspx / 1 [ ^ ]

How do you optain a SOAP response message in visual studio

TCP/ip monitoring ?

解决方案

Quote:

Save the following code with the name SqlSoapTracer.cs in the same folder that contains the SOAP client project files.
In the Solution Explorer window, perform the following steps:
Select the project by name, right-click and point to Add, and then select Add Existing Item.
In the Add Existing Item dialog box, browse and select the SqlSoapTracer.cs file from the location you saved it to in step 1.
Select Show All Files and expand the Web References node and select the Reference.cs file.
In the Code Editor window, update the Reference.cs file by locating the entry points for your Web methods there. To add SOAP trace support when the Web methods execute in client code, add the following snoopattribute() call in the Reference.cs code directly before the entry point for each Web method you want to trace, as shown in the following lines of code.

1
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:ContactService#login", RequestNamespace="urn:ContactService", ResponseNamespace="urn:ContactService")]
2
[return: System.Xml.Serialization.SoapElementAttribute("token")]
3
[snoopattribute()]
4
public string login(string user, string pass, login_options login_options) { object[] results = this.Invoke("login", new object[] { user, pass, login_options}); return ((string)(results[0])); }




This registers a SOAP extension that invokes the SOAP tracing of these Web methods when they are executed.



http://forums.asp.net/t/1827540.aspx/1[^]


这篇关于SOAP响应消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆