Bonjour tout le monde,
J'ai configuré le service reporting sur mon poste, je l'y accède via le lien :
http://localhost/ReportServer (dans le web ça se lance bien).
Dans mon projet, j'ai un projet de type "librairie" et un autre de type WPF(MVVM), dans mon projet Librairie j'ai la fonction suivante :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| /// <summary>
/// Fonction qui permet d'appeler la fonction Listchildren du ReportingService2005.
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public static string GetStartPathValues()
{
try
{
ReportingService.ReportingService2005SoapClient client = new ReportingService2005SoapClient();
System.Net.NetworkCredential cred = new NetworkCredential("ramine","bj286418","gfi-rachid");
client.ClientCredentials.Windows.ClientCredential = cred;
CatalogItem[] ci = new CatalogItem[5000];
client.ListChildren("/", true, out ci);
//reportService.ListChildren("test", true);
return "cocococ";
}
catch(System.ServiceModel.Security.MessageSecurityException ex )
{
throw ex;
}
} |
que j'appelle depuis le projet WPF.
Voici les deux fichiers de configuration :
du projet Librairie :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| <?xml version="1.0" encoding="utf-8" ?>
<configuration>
<applicationSettings>
<LibGNetConfig.Properties.Settings>
<setting name="LibGNetConfig_ReportService2005_ReportingService2005"
serializeAs="String">
<value>http://gfi-rachid:80/ReportServer/ReportService2005.asmx</value>
</setting>
</LibGNetConfig.Properties.Settings>
</applicationSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ReportingService2005Soap" 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="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>-->
<security >
<transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm="" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://gfi-rachid:80/ReportServer/ReportService2005.asmx"
binding="basicHttpBinding" bindingConfiguration="ReportingService2005Soap"
contract="ReportingService.ReportingService2005Soap" name="ReportingService2005Soap" />
</client>
</system.serviceModel>
</configuration> |
du projet wpf :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| <configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<!--Les chemins des fichiers nécéssaires à* l'application-->
<appSettings>
<!-- Begin Configuration Files-->
<add key="web.config" value="E:\GNet_app\WEB\Web.config"/>
<add key="gncs.xml" value="E:\GNet_app\GNCS\App.GNetCalcServices.InstallConfig.xml"/>
<add key="gnis.xml" value="E:\GNet_app\GNIS\App.InstallConfig.xml"/>
<add key="gncs.config" value="E:\GNet_app\GNCS\GNetCalcServices.exe.config"/>
<add key="gnis.config" value="E:\GNet_app\GNIS\ConteneurService.exe.config"/>
<add key="hotfixer.config" value="E:\GNet_app\AddOns\HFInstallerSetup_v103\HFInstaller.exe.config"/>
<add key="GNISOracle.config" value="E:\GNet_app\GNIS\exemple\App.config.Oracle"/>
<add key="GNISSqlServer.config" value="E:\GNet_app\GNIS\exemple\App.config.SqlServer"/>
<!-- End Configuration Files-->
<add key="fileToDelete" value="E:\GNet_app\WEB\Web.config"/>
<add key="fileToCopy" value="E:\GNet_app\WEB\Web.config"/>
<!-- Begin Tools-->
<add key="gestEasy" value="E:\GNet_app\GNetAdm\GestorEasy.exe"/>
<add key="vDebug" value="E:\GNet_app\GNetAdm\VDebug.exe"/>
<add key="sql" value="E:\GNet_app\GNetAdm\SQLODBC.exe"/>
<add key="hotFixer" value="E:\GNet_app\AddOns\HFInstallerSetup_v103\HFInstaller.exe"/>
<add key="synchroBase" value="E:\GNet_app\GNetAdm\SynchroBase.exe"/>
<!-- End Tools-->
<!--L'url de serveur de GestorNet-->
<add key="urlGestorNetServer" value="http://localhost/"/>
<!--Le pool d'application GestorNet-->
<add key="poolApplicationGestorNet" value="nomDupool"/>
</appSettings>
<!--<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>
</configSections>
-->
<connectionStrings>
<add name="GNetConnectStr" connectionString="Data Source=GFI-RACHID;Initial Catalog=GNET_V1.5.1;User ID=GESTADM;Password=bj286418;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<!--<dataConfiguration defaultDatabase="GNetConnectStr"/>-->
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ReportingService2005Soap" 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="None">
--><!--<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>--><!--
<transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>-->
<security>
<transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm="" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://gfi-rachid:80/ReportServer/ReportService2005.asmx"
binding="basicHttpBinding" bindingConfiguration="ReportingService2005Soap"
contract="ReportingService.ReportingService2005Soap" name="ReportingService2005Soap" />
</client>
</system.serviceModel>
</configuration> |
J'ai fait la même solution proposée dans ce post :http://www.developpez.net/forums/d10...hentification/
mais ça marche pas, et j'ai toujours la même erreur:
La demande HTTP nest pas autorisée avec un modèle dauthentification client « Anonymous ». Len-tête dauthentification reçu du serveur était « Negotiate,NTLM ».
Avez-vous une idée pour ça SVP?
Merci d'avance.
Partager