1

Je héberge un service WCF dans IIS, il fonctionne très bien sur un seul système, mais quand j'essaye d'y accéder en utilisant la machine distante (mon système a ip statique), il me demander le nom d'utilisateur et mot de passe, quand je fournis des informations d'identification que l'utilisation de l'ordinateur, il ne l'accepte pas Image 1 montre ce chiffre,WCF Service hébergement dans IIS et l'accès en utilisant IP statique

<?xml version="1.0"?> 

<bindings> 
    <basicHttpBinding> 
    <binding name="Service1Soap"> 
     <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Ntlm" proxyCredentialType="None" 
      realm=""/> 
     <message clientCredentialType="UserName" algorithmSuite="Default"/> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 
<services> 
    <service name="WCF_Static.WCF_Service" behaviorConfiguration="maxBehaviour"> 
    <endpoint address="staticip" binding="basicHttpBinding" contract="WCF_Static.IWCF_Service" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://localhost/8080"/> 
     </baseAddresses> 
    </host> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="maxBehaviour"> 
     <serviceMetadata httpGetEnabled="true"/> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 

enter image description here

Sur proxy côté client J'utilise

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <startup> 
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> 
    </startup> 
    <system.serviceModel> 
     <bindings> 
      <basicHttpBinding> 
       <binding name="BasicHttpBinding_IWCF_Service" /> 
      </basicHttpBinding> 
     </bindings> 
     <client> 
      <endpoint address="http://123.123.123.123/Alias/Service.svc/staticip" 
       binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWCF_Service" 
       contract="ServiceReference1.IWCF_Service" name="BasicHttpBinding_IWCF_Service" /> 
     </client> 
    </system.serviceModel> 
</configuration> 

Liens here Arbitré Merci,

Répondre

0

trouvé! ! :)

service Déployez comme http://localhost/abc/Service1.svc?wsdl ou (http://127.0.0.1/abc/Service1.svc?wsdl) dans IIS, côté client ajouter une référence de service comme http://localhost/abc/Service1.svc?wsdl ou http://127.0.0.1/abc/Service1.svc?wsdl,

mais appconfig côté client

changez le localhost ou 127.0.0.1 à votre adresse IP où ac Le service WCF courant est en cours d'exécution. dans cette adresse comme point final de point final

= "http://123.123.123.123/max/Service.svc/static"