Bonjour,
Je viens de convertir un projet web qui contient notamment des webservices. La conversion se passe sans problème, je lance mon site web sans problè-me, par contre au premier appel d'un de mes services web il n'y arrive plus. Il me dit problème de endpoints, et qu'une raiaons peut-être qu'ils ne sont pas définis. J'ai trouvé la raison, mais j'aimerais savoir comment le régler en fait...
En effet, la conversion m'a modifié mon machine.config où j'avais défini mes bindings sur mes services web. Le fichier est passé donc de ça:
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
...
<system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="MaWebAppClientBehavior">
          <clientCredentials>
            <clientCertificate findValue="Certcl2" storeLocation="LocalMachine" storeName="TrustedPeople" x509FindType="FindBySubjectName"/>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="false" logMessagesAtServiceLevel="false" logMessagesAtTransportLevel="false"/>
    </diagnostics>
    <bindings>
      <wsHttpBinding>
        <binding name="MaWebAppWSHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="20000000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
          <security mode="None">
            <transport clientCredentialType="Certificate" proxyCredentialType="None" realm=""/>
            <message clientCredentialType="None" negotiateServiceCredential="false" algorithmSuite="Default" establishSecurityContext="false"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost/MaWebApp2/ServiceDataAccess/ServiceDataAccess.svc" behaviorConfiguration="MaWebAppClientBehavior" binding="wsHttpBinding" bindingConfiguration="MaWebAppWSHttpBinding" contract="Societe.MaWebApp.ServiceProxies.ServiceDataAccess.ServiceDataAccess" name="WSHttpBinding_ServiceDataAccess"/>
      <endpoint address="http://localhost/MaWebApp2/ServiceDataTrades/ServiceDataTrades.svc" behaviorConfiguration="MaWebAppClientBehavior" binding="wsHttpBinding" bindingConfiguration="MaWebAppWSHttpBinding" contract="Societe.MaWebApp.ServiceProxies.ServiceDataTrades.ServiceDataTrades" name="WSHttpBinding_ServiceDataTrades"/>
    </client>
  </system.serviceModel>
...
à ca:
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
...
<system.serviceModel>
    <extensions>
      <behaviorExtensions>
        <add name="persistenceProvider" type="System.ServiceModel.Configuration.PersistenceProviderElement, System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
        <add name="workflowRuntime" type="System.ServiceModel.Configuration.WorkflowRuntimeElement, System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
        <add name="enableWebScript" type="System.ServiceModel.Configuration.WebScriptEnablingElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
        <add name="webHttp" type="System.ServiceModel.Configuration.WebHttpElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
      </behaviorExtensions>
      <bindingElementExtensions>
        <add name="webMessageEncoding" type="System.ServiceModel.Configuration.WebMessageEncodingElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
        <add name="context" type="System.ServiceModel.Configuration.ContextBindingElementExtensionElement, System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
      </bindingElementExtensions>
      <bindingExtensions>
        <add name="wsHttpContextBinding" type="System.ServiceModel.Configuration.WSHttpContextBindingCollectionElement, System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
        <add name="netTcpContextBinding" type="System.ServiceModel.Configuration.NetTcpContextBindingCollectionElement, System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
        <add name="webHttpBinding" type="System.ServiceModel.Configuration.WebHttpBindingCollectionElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
        <add name="basicHttpContextBinding" type="System.ServiceModel.Configuration.BasicHttpContextBindingCollectionElement, System.WorkflowServices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35" />
      </bindingExtensions>
    </extensions>
 
    <client>
      <metadata>
        <policyImporters>
          <extension type="System.ServiceModel.Channels.ContextBindingElementImporter, system.workflowservices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35, processorArchitecture=MSIL" />
        </policyImporters>
        <wsdlImporters>
          <extension type="System.ServiceModel.Channels.ContextBindingElementImporter, system.workflowservices, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31b64425212g2e35, processorArchitecture=MSIL" />
        </wsdlImporters>
      </metadata>
    </client>
  </system.serviceModel>
...
En gros je n'ai plus du tout de déclarations de mes services web... Pourquoi VS fait ça? Comment convertir entièrement le projet pour qu'il fonctionne donc?
Précision : Je suis passé du coup aussi du framework 2.0 au 3.5. Ca a peut-être un lien.
D'avance merci pour vos suggestions si vous avez déjà rencontré ce genre de problèmes ou bien même si vous n'en avez pas eu en convertissant un projet web de VS2005 vers VS2008 pour me dire si vous avez fait une action particulière donc.
Julien