2017-01-24 1 views
1

Je rencontre un problème lors de l'appel d'un WCF hébergé dans une application Web C#.IIS 8 - EndpointNotFoundException dans WCF

J'ai essayé d'appeler le webservice lorsque le serveur est hébergé chez local et cela a fonctionné sans aucun problème.

Cependant, je suis l'erreur « Il n'y avait pas à l'écoute point final https://cloud.my/MyService/GenerateWCF1.svc » lorsque le serveur est hébergé à IIS 8.

Note: Je peux parcourir en insérant directement le lien lorsqu'il est hébergé chez IIS 8.

code client derrière

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> 

Config serveur Web

<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> 

Répondre

1

Problème résolu.

résolu par étapes suivantes:

  1. Changement SECURITYMODE à "TransportCredentialOnly" au lieu de "Transport"
  2. Adresse encodée à http au lieu de https
  3. Définir ou d'informations d'identification SSL by-pass.
  4. modifier votre URL nom à l'adresse IP (ex .: https://myurltest.com/WCFName.svc à http://192.1.1.1/WCFName.svc)

Modifié: Une étape importante 4 j'ai oublié d'ajouter à la dernière fois.