是否可以从网址动态更新wsdl文件? 此代码指向存在静态wsdl文件的路径。 如何在第二行修改代码:
using System;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Activation;
using System.IO;
namespace ExampleRESTService
{
[ServiceContract(Name = "RESTServices")]
public interface IRESTServices
{
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = Routing.Route, BodyStyle = WebMessageBodyStyle.Bare)]
string GetCounts();
}
public static class Routing
{
public const string Route = "/GetCounts";
}
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single, IncludeExceptionDetailInFaults = true)]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class RESTServices : IRESTServices
{
public string GetCounts()
{
string sData = "Hello"
return sData;
}
}
}