views:

11

answers:

1

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>

+1  A: 

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

Chris
The example I have from MSDN (David Chappell) shows the address to be http://www.fabrikam.com/reservation/reserve.svc. However, other MSDN help seems not to use the .svc extension. Is this because of some examples being obsolete?
broiyan
As far as I know, it's because when WCF first came out, IIS 6 was the primary hosting environment. Since IIS 6 does not support extensionless urls by default, the .svc was added so an extension could be mapped in IIS. This is not necessary when hosting via TCP or any other binding, really.
Chris