加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

发布WebService

发布时间:2020-12-17 02:40:54 所属栏目:安全 来源:网络整理
导读:using System;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Diagnostics;[WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]public class S
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Diagnostics;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class SetEventStatus : System.Web.Services.WebService
{
    public SetEventStatus()
    {

        //如果使用设计的组件,请取消注释以下行 
        //InitializeComponent(); 
    }

//    [WebMethod]
    //   public string HelloWorld() {
    //       return "Hello World";
    //   }
    [WebMethod(Description = "签单、结单事件状态回写,SetES(ticketstatus,event_id),参数ticketstatus为工单状态,1为已签单,2为结单")]
    public string SetES(int ticketstatus,string event_id)
    {
        string[] tmpstr = event_id.Split('_');
        string event_handle = null;
        if (tmpstr.Length > 1)
            event_handle = tmpstr[1];
        switch (ticketstatus)
        {
            case 1:
                {
                    System.Diagnostics.Process app = new System.Diagnostics.Process();
                    app.StartInfo.WorkingDirectory = @"C:/Program Files/BMC Software/Impact/server/bin";
                    app.StartInfo.Arguments = "-n computer -i "+event_handle+" -A";
                    app.StartInfo.FileName = "msetmsg.exe";
                    app.Start();
 /*                   if (app.HasExited)
                        app.Close();
                    else
                        app.Kill();
  */ 
                }
                return "set ACK OK";
            case 2:
                {
                    System.Diagnostics.Process app = new System.Diagnostics.Process();
                    app.StartInfo.WorkingDirectory = @"C:/Program Files/BMC Software/Impact/server/bin";
                    app.StartInfo.Arguments = "-n computer -i "+ event_handle +" -C";
                    app.StartInfo.FileName = "msetmsg.exe";
                    app.Start();
/*                    if (app.HasExited)
                        app.Close();
                    else
                        app.Kill();
 */ 
                }
                return "set CLOSED OK";
            default:
                return "event_id error";
        }
    }
    
}

以上为服务端代码

安装IIS---->部署网站---->创建网站---->访问测试部署中注意的问题

Windows2003中asp.net程序布署中的问题

(1)如果先安装vs.net2005,后安装IIS6,可以在vs2005命令提示下运行aspnet_regiis?? -i????

(2)您试图从目录中执行?? CGI、ISAPI?? 或其他可执行程序,但该目录不允许执行程序。解决:配置IIS,主目录-> 执行权限-> 纯脚本??

(3)您正在搜索的页面可能已经删除、更名或暂时不可用。解决:可以在WEB服务器扩展中打开asp.net2.0

(4)如果在使用express数据库时,提示“数据库是只读的”,可以进入IIS管理器,选择相应的数据库文件,在“属性”中选择“写入”,,如果还不好使,我们只需要在数据库的目录权限里添加上“IUSR_计算机名”用户就可以了,分给它“写入”权限。我发现一些文章说让加入EveryOne用户,并给“写入”权限,这个太危险了。原则上是此目录加的可以写入用户就是在IIS中配置的时候加的?? Internet匿名访问用户,一般默认为“IUSR_计算机名”,不过如果是虚拟主机就要自己看看了。

(5)所有配置都已经检查,系统提示《无法显示网页》,可能原因是在IIS中配置了主机头,而主机头配置错误,正确的主机主应当是类于:www.gogolike.com,而不是gogolike.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读