简体   繁体   English

调试C#Web服务

[英]Debug C# web service

I have a web service project and simple test application. 我有一个Web服务项目和简单的测试应用程序。 I can debug the web service from Visual Studio 2008. However, there exist a real client application, but it is on another machine. 我可以从Visual Studio 2008调试Web服务。但是,存在一个真实的客户端应用程序,但是它在另一台计算机上。 ASP.NET Development Server does not allow connections if they are not from localhost, or so it seems. 如果不是来自本地主机,则ASP.NET Development Server不允许连接,或者看起来不是。 Is there a way to debug a web service, if client application is on another machine? 如果客户端应用程序在另一台计算机上,是否可以调试Web服务?

Edit 编辑

The tool that I used is Trace Utility from Microsoft SOAP Toolkit . 我使用的工具是Microsoft SOAP Toolkit中的 Trace Utility。 Further explanation can be found here (works on XP; see continuation story for Windows 7 solution). 可以在此处找到进一步的说明(在XP上运行;请参见Windows 7解决方案的续订故事 )。 There was problem with it though. 虽然有问题。 My remote client fetches the WSDL first, and then creates URL based on values in soap tags found at the end of WSDL. 我的远程客户端首先获取WSDL,然后根据WSDL末尾的soap标记中的值创建URL。 So client gets redirected to localhost, which is not good. 因此客户端被重定向到本地主机,这是不好的。

I found my problem though, but I'll leave the question open until I find the time to try debugging via IIS. 虽然我发现了问题,但是我将把问题悬而未决,直到找到时间尝试通过IIS调试为止。

Install a virtual directory into the IIS on your local machine. 在本地计算机上的IIS中安装虚拟目录。 If you don't have IIS, install it. 如果没有IIS,请安装它。 Once IIS is installed and configured on your local machine, you should be able to use either the IP or create a dns alias for that IP to access the web service that way. 在本地计算机上安装并配置IIS之后,您应该能够使用IP或为该IP创建dns别名,以这种方式访问​​Web服务。

我正在使用SoapUI基本版本来伪造从本地计算机到Web服务的SOAP请求,该Web服务在Visual Studio中以调试模式运行。

您可以使用IIS(或Cassini Web服务器 )进行调试-将VS 2008连接到正确的进程(例如w3p.exe(IIS6或更高版本)或aspnet_wp.exe(IIS 5))。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM