[英]Recognize WCF solution
我是 .NET 中 Web 服务开发的新手。 现在我正在分析一个包含数十个项目的大型解决方案。 在那里我有一个使用 Web 服务的项目,我想知道它是WCF 服务还是其他类型的Web API ......
过去我在 .NET 中使用ASMX Web 服务,您可以通过其文件扩展名识别ASMX Web 服务。 但是在这里我没有看到项目中有任何特殊的扩展。 我读过 WCF 服务有 .svc 文件,如果它们托管在 IIS 中。 但是这个项目没有 .svc 文件。 那么,将 WCF 服务与 .NET 中的其他 Web 服务区分开来的主要特征是什么? 解决方案的结构如下:
-Solution
+-CreateDocWebServiceInterface
+-CreateDocWebService
+-...
CreateDocWebServiceInterface
看起来像这样:
namespace CreateDocWebServiceInterface
{
/// <summary>
/// </summary>
[ServiceContract(Name = "ICreateDocWebService", Namespace = "http://www.standardlife.de/CreateDocWebService")]
[RequiredParametersBehavior]
[ServiceKnownType(typeof(Bookmark))]
[ServiceKnownType(typeof(List<Bookmark>))]
public interface ICreateDocWebService
{
[OperationContract]
byte[] CreateDoc(OutputFormat OutputFormat, bool DuplexPrinting, List<Document> Documents);
}
}
CreateDocWebService
看起来像这样:
namespace CreateDocWebService
{
// single threaded, but each request is handled concurrent !
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single, Namespace = "http://www.blablabla.de/CreateDocWebService")]
public class CreateDocWebService : ICreateDocWebService
{
public byte[] CreateDoc(OutputFormat outputFormat, bool duplexPrinting, List<Document> documents)
{
bla bla bla
}
}
}
它可能是一个带有Web API的 Web 服务,但据我所知,Web API Web 服务由派生自ApiController
的控制器组成?!(这是正确的以及 Web Api Web 服务的独特特征吗?)那么这是一个 WCF 服务吗? WCF 服务和 Web API Web 服务的独特特征是什么
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.