У меня возникла проблема при вызове WCF, размещенного в веб-приложении C#.IIS 8 - EndpointNotFoundException в WCF
Я попытался вызвать веб-сервис, когда сервер размещен на локальном компьютере, и он работал без каких-либо проблем.
Однако я получил ошибку «Там не было конечной точкой прослушивания в https://cloud.my/MyService/GenerateWCF1.svc», когда сервер размещен на IIS 8.
Примечание: я могу просматривать его непосредственно вставив ссылку, когда он размещен на IIS 8.
Client Code Behind
ERPGenerateWCF1.GenerateWCF1Client GenerateWCF1 = new ERPGenerateWCF1.GenerateWCF1Client(); GenerateGST03.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
var address = new EndpointAddress("https://cloud.my/MySystem/GenerateWCF1.svc");
GenerateWCF1 = new ERPGenerateWCF1.GenerateWCF1Client("BasicHttpBinding_IGenerateWCF1", address);
ErrorMsg = GenerateWCF1.DoWork();
Client Web.Config
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IGenerateWCF1" receiveTimeout="00:45:00"
sendTimeout="00:45:00" maxReceivedMessageSize="600000000">
<security mode="Transport">
<transport clientCredentialType="Ntlm" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="BasicHttpBinding_IGenerateWCF2" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:56498/MySystem/GenerateWCF1.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGenerateWCF1"
contract="ERPGenerateWCF1.IGenerateWCF1" name="BasicHttpBinding_IGenerateWCF1" />
<endpoint address="http://localhost:55777/MySystem/GenerateWCF2.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGenerateWCF2"
contract="GenerateWCF2.IGenerateWCF2" name="BasicHttpBinding_IGenerateWCF2" />
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</client>
</system.serviceModel>
Сервер Web Config
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IGenerateWCF1" receiveTimeout="00:45:00"
sendTimeout="00:45:00" maxReceivedMessageSize="600000000">
<security mode="Transport">
<transport clientCredentialType="Ntlm" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="BasicHttpBinding_IGenerateWCF2" />
</basicHttpBinding>
</bindings>
</system.serviceModel>