开发者

What kinds of non-HTTP addresses are allowed in WCF endpoints?

开发者 https://www.devze.com 2023-01-15 03:31 出处:网络
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

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>开发者_StackOverflow
  </service>
 </services>


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

0

精彩评论

暂无评论...
验证码 换一张
取 消