I have the following,
PostCodes is my solution it is an ASP.NET Web forms application I have two services,
Everything was working fine until I started to add some real stuff to
IService2. This meaning started to make constructors and I now receieve and error from the WCF test client that states (When i hit run inside my Service2.svc.cs tab)
"Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata."
here is my Web.Config
<configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
Now I have tried time and time again to allow my WCF test client to obtain the meta data by adding endpoints to the web.config file as follows
<services> <service name="Service2" // behaviorConfiguration="DefaultBehavior"> <endpoint address=http://localhost/Service2 binding="basicHttpBinding" contract="IService2" /> <endpoint address="http://localhost/Service2/mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services>
To clairfy My solution is called PostCodes, I have two services, Service1 and Service2
The above did not work, and I still get the error when running the WCF Test Client...
I am not running this online or anything this is purely to run through the Test Client and on my local machine.
So my question is - What have I done wrong in adding these end points and how can I fix it.
Any advice would be great,
Post below for any clarifications if needed