我无法让我的本地环境在模拟器中运行我想要的 Azure 部署。
我有一个(MyWebSite)
具有公共 (InputEndpoint) 的 WebRole 和一个具有 InternalEndpoint 的 WebRole (MyServiceApplication)
。InternalSite 具有一组向 PublicSite 公开的 WCF 服务。
IE
<WebRole name="MyServiceApplication" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="MyInternalEndpoint" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InternalEndpoint name="MyInternalEndpoint" port="8083" protocol="http"></InternalEndpoint>
</Endpoints>
</WebRole>
<WebRole name="MyWebSite" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
</WebRole>
我从 MyWebSite 以编程方式连接到 MyServiceApplication 端点。IE。
var applicationRole = RoleEnvironment.Roles["MyServiceApplication"].Instances.First().InstanceEndpoints["MyInternalEndpoint"].IPEndpoint;
var endPointAddress = string.Format("http://{0}:{1}/MyService.svc", applicationRole.Address, applicationRole.Port);
var channel = channelFactory.CreateChannel(new EndpointAddress(endPointAddress));
该endPointAddress
变量原来是http://127.0.0.1:8083/MyService.svc
在 Azure Emulator Express 中运行时,但它抱怨:
没有
http://127.0.0.1:8083/MyService.svc
可以接受消息的端点监听。
但是,当我通过 浏览到此端点时http://localhost:8083/MyService.svc
,我没有问题。
所以我想问题是,我怎样才能127.0.0.1
在 Azure Emulator Express 中绑定到 InternalEndpoint(而不是 localhost),或者有没有一种方法可以以编程方式将端点解析为http://localhost:8083/MyService.svc
?
希望有人能帮忙,