发布WebService

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值