zoukankan      html  css  js  c++  java
  • VS中调试Web Service

    创建并发布WebService后,外部程序调用它时,有时想进到WebService源代码(Visual Studio)里面单步调试。
    1.编写编译,并发布WebService服务

    image

    image

    打开iis(Internet Information Services (IIS)管理器)右键网站-添加网站,打开目录浏览权限

    image

    2.开始调试

    打开配置好的网站 以启动此网站的w3wp.exe进程

    点击浏览,并访问asmx文件:

    image

    在VS中将WebService项目设置为启动项,在要调试的地方,设置断点。

    点击调试菜单下附加到进程

    image

    可能会出现多个w3wp.exe 根据用户名选中配置调试项目的w3wp.exe进程 然后点击附加

    image

    附加后进行测试:

    image

    可以看到进入断点:

    image

    3.服务引用.net2.0

    image

    image

    image

    调用wcf:

    public bool DocDelete(string username,string password,string docId, out string errorStr)
            {
                errorStr = string.Empty;
    
                //调用ELN服务
                //ElnWFService.WFService elnWFService = new ElnWFService.WFService();
                using (SRGWCF.WFService elnWFService = new SRGWCF.WFService())
                {
    
                    bool status = elnWFService.DeleteExperiment(AppConfig.ElnServer,username,password, docId,out errorStr);
                    if (!status)
                    {
                        //errorStr += docId + "删除私人目录实验记录失败。";
                        return false;
                    }
    
                }
    
                return true;
            }

    完成

  • 相关阅读:
    Mysql基础
    Mysql基础2
    Windows CMD命令大全
    python 调试方法
    LDAP
    Linux 内核与模块调试
    Linux tee命令
    Linux kgdb命令
    OpenSSL基础知识
    Linux top命令
  • 原文地址:https://www.cnblogs.com/shenerguang/p/14949739.html
Copyright © 2011-2022 走看看