将Web服务发布到服务器 [英] publish web service to server
本文介绍了将Web服务发布到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我做了一个网络服务:
I did a web service :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data.SqlClient;
using System.Data;
namespace MemberWebService
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public DataSet GetMemberData(string memberId, string thirdName)
{
SqlConnection cn = new SqlConnection("Data Source=.;Initial Catalog=Healthy;Integrated Security=TRUE");
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
da.SelectCommand = new SqlCommand("SELECT * FROM MemberMaster WHERE MemberId=@MemberId and ThirdName=@ThirdName", cn);
da.SelectCommand.Parameters.Add("@MemberId", SqlDbType.NVarChar).Value = memberId;
da.SelectCommand.Parameters.Add("@ThirdName", SqlDbType.NVarChar).Value = thirdName;
ds.Clear();
da.Fill(ds);
return ds;
}
}
}
当我运行它时,它正在我的localhost上运行我想在另一台服务器上运行它,比如这个链接: http://62.215.220.133/SHAMiphone/sip.asmx
我该怎么办?
when i run it, it is working on my localhost i want to run it on another server like this link : http://62.215.220.133/SHAMiphone/sip.asmx
How can i do that ?
推荐答案
用于托管Web服务(类似于Web应用程序):
1.在IIS7中:在IIS上部署ASP.NET网站7.0 [ ^ ]
2.在IIS6中:在IIS上部署网站 [ ^ ]
如何使用托管的Web服务:如何创建一个简单的WebService并使用它。 [ ^ ]
For hosting the Webservice (similar to web application):
1. In IIS7: Deploying ASP.NET Websites on IIS 7.0 [^]
2. In IIS6: Deployment of a Website on IIS[^]
How to use the hosted webservice: How to make a simple WebService and consume it.[^]
这篇关于将Web服务发布到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文