am first time using WCF Service and when i add 2 endpoints it is working fine and While adding the third endpoint in the web.config it showing the following error
the following is my service added in the web.config
<services>
<service behaviorConfiguration="Default" name="WCFCurd.WCFContactService">
<endpoint address="contact" binding="basicHttpBinding" contract="WCFCurd.IWCFContact" />
<endpoint address="Calc" binding="basicHttpBinding" contract="WCFCurd.Ialc" />
<endpoint address="addition" binding="basicHttpBinding" contract="WCFCurd.Addition" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<!--<baseAddresses>
<add baseAddress="http://localhost:4072/WCFCurd"/>
</baseAddresses>-->
</host>
</service>
</services>
the error showing is
Error: Cannot obtain Metadata from http://localhost:4072/WCFContactService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://localhost:4072/WCFContactService.svc Metadata contains a reference that cannot be resolved: 'http://localhost:4072/WCFContactService.svc'. There was no endpoint listening at http://localhost:4072/WCFContactService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (404) Not Found.HTTP GET Error URI: http://localhost:4072/WCFContactService.svc There was an error downloading 'http://localhost:4072/WCFContactService.svc'. The request failed with the error message:-- Service
The service encountered an error.
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.DataContractSerializerOperationBehavior
when the WCFContactService.scv run it will not , which showing th e above error when third endpoint is added
The following example you can understand will help you , try with this example
public int SimpleExample(<interface> Example1)
{
return Example1.ID;
}
public int SimpleExample1(<interface> Example2)
{
return Example2.ID;
}
public int SimpleExample2(<interface> Example3)
{
return Example3.ID;
}
public int SimpleExample3(<interface> Example4)
{
return Example4.ID;
}
public int SimpleExample4(<interface> Example5)
{
return Example5.ID;
}
public int SimpleExample5(<interface> Example6)
{
return Example6.ID;
}
.......
public int SimpleExampleN(<interface> ExampleN)
{
return ExampleN.ID;
}
i din't find out any error in the above code in web.config. this may be occurred due to conflict of the function names or any interface name.