Atul Band

Atul Band

  • NA
  • 151
  • 17.2k

WCF Service

Feb 16 2016 2:19 AM

I have created on basic WCF service in VS2015, when I add reference in console application then I will give following error

 

"There was an error downloading 'http://localhost:8080/WcfService/Service1/$metadata'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it [::1]:8080
Metadata contains a reference that cannot be resolved: 'http://localhost:8080/WcfService/Service1'.
There was no endpoint listening at http://localhost:8080/WcfService/Service1 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it [::1]:8080
If the service is defined in the current solution, try building the solution and adding the service reference again." 
 
 
 
And my app.config is
 

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<appSettings>

<!-- use appSetting to configure base address provided by host -->

<!--<add key="baseAddress" value="http://localhost:11005/WcfService/Service1" />-->

</appSettings>

<system.web>

<compilation debug="true" targetFramework="4.5" />

</system.web>

<system.serviceModel>

<services>

<service name="WcfService.Service1" behaviorConfiguration="metadataBehavior">

<endpoint address="Service1" binding="basicHttpBinding" contract="WcfService.IService1"></endpoint>

       

<!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />-->

<host>

<baseAddresses>

<add baseAddress="http://localhost:8080/WcfService/Service1"/>

</baseAddresses>

</host>

</service>

</services>

<behaviors>

<serviceBehaviors>

<behavior name="metadataBehavior">

<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>

<serviceDebug includeExceptionDetailInFaults="False" />

</behavior>

</serviceBehaviors>

</behaviors>

</system.serviceModel>

</configuration>

 
How to solve this error? 
 

Answers (2)