Bonjour,
J'ai un service avec une interface.
J'ai commencé par le généré en Webservice et cela a fonctionné.
Ensuite j'ai voulu l'installer en tant que service windows. J'ai utiliser le même app.config :
Coté client, le app config est le suivant (il n'a pas changé entre le webservice et le service windows) : [EDIT : j'avais posté le mauvais app.config. voici le bon app.config du client]
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <services> <service behaviorConfiguration="ImportServiceBehaviour" name="DataImport.ImportEngine.Importer"> <endpoint address="" binding="wsHttpBinding" name="ImportService" contract="DataImport.ImportEngine.IImporter" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://mon_ip:7501/ImportService" /> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ImportServiceBehaviour"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <client /> </system.serviceModel> </configuration>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <system.serviceModel> <diagnostics> <messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" logEntireMessage="true"/> </diagnostics> <bindings> <wsHttpBinding> <binding name="wsHttpBindingConf" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="None"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://mon_ip:7501/ImportService" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingConf" contract="ImportService.IImporter" name="ImportService"> <identity> <dns value="localhost" /> </identity> </endpoint> </client>
Mon problème est le suivant. Mon client arrive parfaitement a acceder au Webservice. Mais lorsque que j'appelle une méthode du Service windows, j'ai l'erreur suivante :
The message could not be processed. This is most likely because the action 'http://tempuri.org/IImporter/GetListSchema' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.
Merci par avance.
Partager