[英]Error when calling Web API with self-hosted Azure Service Fabric
I am using a new Azure Service Fabric project. 我正在使用一个新的Azure Service Fabric项目。 The project contains 2 statefull services as shown in the below image: 该项目包含2个statefull服务,如下图所示:
When I run the application, the explorer is shown successfully as below: 当我运行该应用程序时,资源管理器成功显示如下:
But when I try to hit my API, http://localhost:19080/api/values , I get the below Invalid argument
error. 但是当我尝试访问我的API http:// localhost:19080 / api / values时 ,出现以下Invalid argument
错误。 It does not hit the controller: 它不会命中控制器:
Kindly advise how to solve this error. 请告知如何解决此错误。
Port 19080 is used by the Service Fabric explorer . Service Fabric资源管理器使用端口19080。 You should choose a different port to run your own service on. 您应该选择其他端口来运行您自己的服务。
As LoekD mentioned, port 19080 is used by the Service Fabric explorer. 如LoekD所述,Service Fabric资源管理器使用端口19080。 You can find the actual port of your application in ServiceManifest.xml of API project. 您可以在API项目的ServiceManifest.xml中找到应用程序的实际端口。 There should be the section Resources with Endpoints like: 应该有“具有端点的资源”部分,例如:
<Resources>
<Endpoints>
<Endpoint Protocol="http" Name="ServiceEndpoint" Type="Input" Port="8315" />
</Endpoints>
</Resources>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.