我的笔记本电脑上有一个Windows服务,它托管着WCF服务。我想在我的ASP.NET网站上使用这些服务,该网站位于外部ASP.NET服务器上。如何在互联网上发布WCF服务(在wnd服务中托管)
你能帮帮我,怎么做?
是否需要特定的笔记本电脑配置?我应该配置什么?
和绑定,什么类型将足够? ..现在,我已经有了:
<service behaviorConfiguration="WcfServices.InfoBehavior" name="MyProgram.WcfServices.Info.Info">
<endpoint address="" binding="wsHttpBinding" contract="MyProgram.WcfServices.Info.IInfo">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Info/" />
</baseAddresses>
</host>
</service>
UPDATE: 现在,我的客户端应用程序仍然在我的笔记本电脑(它没有公布尚未)。这是我的客户端代码:
<client>
<endpoint address="http://localhost:8732/Info/" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IInfo" contract="ServiceInfo.IInfo"
name="WSHttpBinding_IInfo">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
我不知道,什么绑定使用什么端口,应该在我的笔记本电脑上更改什么设置?
我不认为是一个好主意,如果LapTop关闭或断开连接,ASP.NET网站仍然可以正常工作?无论如何,从绑定可能这不是最好的:localhost:8732,实际上你应该显示客户端配置不是服务器。向我们展示如何从ASP.NET web.config文件引用笔记本电脑的服务 –
好吧,Web应用程序仅显示有关运行Windows服务的一些信息。当wnd服务停止时,有关于网络的说明。这是我的个人网页,而不是公共门户。 – Marshall