I'm working on my first WCF service and am getting an error when trying to launch the service inside of visual studio. So, it will be running under Cassini.
The error is:
Error: Cannot obtain Metadata from http://localhost:1393/BEService.svc
Here is my configuration
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="metadataBehavior" name="DataServices.BEService">
<endpoint address="" binding="basicHttpBinding" contract="DataServices.IBEService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:1393" />
</baseAddresses>
</host>
</service>
</services>
Here is my interface that defines the service contract:
[ServiceContract]
public interface IBEService
{
[OperationContract]
string Get271EDI(string EDI, DDKSLib.Enums.EDIRequestor requestor);
}
Here is the class that implements it :
public class BEService : IBEService
{
public string Get271EDI(string EDI, Enums.EDIRequestor requestor)
{
return "this is a test";
}
}
What am I missing?
When changing the WCF configuration, the editor moved all of the configuration to an app.config file. However, a lot of articles i read referenced configuration being in the web.config instead. So, I moved them to the web.config and deleted the app.config. Everything started working. Then, I ran into this question which answered my question about when to use web.config vs app.config..