从Visual Studio 2010 Express中开发的.NET Web服务开始,我如何知道自己为自己服务的WSDL的URL有自己的Web服务?
例如,如果我有一些样板代码
[WebService]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class MyWS : System.Web.Services.WebService
{
[WebMethod(Description="Something like: http://localhost:12345/MyWS.asmx?WSDL")]
public int RegisterInDB(string ConnectionString)
{
string urlWSDL = "HOW_TO_GET_WEBSERVICE'S_OWN_WSDL_URL_HERE ???";
int NewRowId;
// 1) Connect to DB with ConnectionString
// 2) INSERT into table some info, including urlWSDL
// 3) Get Id of INSERT'ed row.
return NewRowId;
}
}
哪个方法/属性在运行时提供WSDL?