dll でホストされている WCF サービスがあり、SvcUtil.exe を使用してプロキシ コードを生成しました。以下はクライアント コードです。
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);
これを実行すると、次のようなエラーが発生します
メッセージを受け入れることができる [http://localhost:8001/MyApplication/Deploy/DeployService/] でリッスンしているエンドポイントはありませんでした。これは、多くの場合、アドレスまたは SOAP アクションが正しくないことが原因です。
サービス構成ファイルは、
<?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>