0

I have a WCF service hosted in dll, I have generated proxy code using SvcUtil.exe, below is my client code,

BasicHttpBinding binding = new BasicHttpBinding();
            binding.Security.Mode = BasicHttpSecurityMode.None;
            EndpointAddress epa = new EndpointAddress("http://localhost:8001/MyApplication/Deploy/DeployService/");
            DeployClient client = new DeployClient(binding, epa);
            deployStatus = client.Deploy(myStringArgument, true);

When I am executing this, I am getting error as

There was no endpoint listening at [http://localhost:8001/MyApplication/Deploy/DeployService/] that could accept the message. This is often caused by an incorrect address or SOAP action

Service Configuration file is,

<?xml version="1.0"?>
<configuration>
  <appSettings>
    <!-- Configurable client send timeout, in seconds  -->
    <add key="DasClientSendTimeoutSeconds" value="1500" />
  </appSettings>
  <system.web>
    <compilation debug="false" />
  </system.web>
  <!-- -->
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="NetTcpBinding" sendTimeout="00:10:00" transferMode="StreamedRequest" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxStringContentLength="2147483647" />
          <!-- Security mode to use when clients are connecting to this Service. -->
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <client />
    <!--         
        <diagnostics>
            <messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="false"/>
        </diagnostics>
        -->
    <services>
      <service behaviorConfiguration="DeployTarget.DeployBehavior" name="MyApplication.Deploy.DeployService">
        <endpoint address="http://localhost:8001/MyApplication/Deploy/DeployService/mex" binding="mexHttpBinding" name="mexEndpoint" contract="IMetadataExchange" />
        <endpoint address="net.tcp://localhost:8002/MyApplication/Deploy/DeployService/" binding="netTcpBinding" bindingConfiguration="NetTcpBinding" name="TcpEndpoint" contract="MyApplication.Common.Interfaces.IDeploy" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8001/MyApplication/Deploy/DeployService/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="DeployTarget.DeployBehavior">
          <!-- To avoid disclosing metadata information, 
                         set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value 
                         below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
</configuration>
Dev
  • 960
  • 2
  • 15
  • 35

1 Answers1

1

Your service is set to use NetTcp, but the client is using Basic Http. The binding protocols must match if you wish for client and service to communicate.

The other other Alan
  • 1,868
  • 12
  • 21