WCF 端点中允许使用哪些类型的非 HTTP 地址?
我只是想通过不了解 IIS 和 WAS 来节省时间,因此我制作了一个控制台应用程序来托管我的 WCF 服务。但是,这让我不确定如何指定非 HTTP 地址的端点地址。以下配置可能是我的运行时错误的根源吗?异常描述为:无法找到与绑定 WSHttpBinding 的端点的方案 http 相匹配的基地址。注册的基地址方案是[]。
<system.serviceModel>
<services>
<service name="WcfService1.Service1">
<endpoint
contract="WcfService1.IService1"
binding="wsHttpBinding"
address="c:\users\owner\documents\visual studio 2010\projects\wcftest\wcfservice1\wcfservice1\service1.svc"/endpoint>
</service>
</services>
I'm just trying to save time by not learning about IIS and WAS, so I made a console application to host my WCF service. However, that leaves me uncertain as to how to specify an endpoint address that is not an HTTP address. Could the following config be the source of my runtime error? The exception description was: Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [].
<system.serviceModel>
<services>
<service name="WcfService1.Service1">
<endpoint
contract="WcfService1.IService1"
binding="wsHttpBinding"
address="c:\users\owner\documents\visual studio 2010\projects\wcftest\wcfservice1\wcfservice1\service1.svc"/endpoint>
</service>
</services>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您要查找的词是绑定。您可以更改绑定属性以匹配支持所需协议的绑定。对于简单的控制台服务主机,我可能会从 netTcpBinding 开始,它允许绑定到 ipaddress:port 组合。
示例:
net.tcp://localhost:8000/myservice
The word you're looking for is bindings. You change the binding attribute to match a binding that supports your desired protocol. For a simple console service host, I'd probably start with the netTcpBinding, which allows binding to an ipaddress:port combination.
Example:
net.tcp://localhost:8000/myservice