Bonjour à tous.
J'ai ouvert un sujet côté C# parlant d'un souci pour accéder à un webService depuis une application WinForm en utilisant la connexion intégrée Windows (le compte windows qui a ouvert la session).
Vous pourrez trouver le sujet ici :
http://www.developpez.net/forums/f48...windows-forms/
Entre temps j'essaie de bidouiller et de continuer de chercher. Je suis reparti sur un "Service Reference" plutôt qu'une "Web Reference" et tenter par ce moyen la qui était un échec pour la gestion du credential.
Voila ou j'en suis avec une erreur :
La demande HTTP n'est pas autorisée avec un schéma d'authentification client 'Ntlm'. L'en-tête d'authentification reçu du serveur était 'NTLM'.
En cherchant l'erreur sur internet je suis tombé sur un post :
http://www.developpez.net/forums/d10...hentification/
Voici mon APP.CONFIG :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="MainSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://interne.site.fr/WebService/Main.Asmx"
binding="basicHttpBinding" bindingConfiguration="MainSoap"
contract="WS2.MainSoap" name="MainSoap" />
</client>
</system.serviceModel> |
Voici mon code :
1 2 3 4 5 6 7 8 9
|
using (PMUWS2.MainSoapClient s2 = new PMUWS2.MainSoapClient())
{
try { myreturn += "|" + s2.HelloWorld(); }
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
} |
Me voila à nouveau dans un cul de sac.
Merci d'avance.
Partager