Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : Pb de connection strings dans un webservice distant [ Archives / Web Service ] (neo557)

mercredi 29 mars 2006 à 15:53:43 | Pb de connection strings dans un webservice distant

neo557

Désolé j'ai du recréer le post car j'avais copier/coller quelque chose de faux. Je récris mon problème :

Bonjour,

J'ai un problème qui doit être bien évident mais je ne m'en sort pas.

J'ai un WebService qui tourne sur un poste, ce webservice possède des méthodes qui reçoivent des strings et retournent des résultats sous format string également. Dans ces méthodes, mon web service effectue des recherches dans une base de données se trouvant sur le même poste.

Si je lance mon service avec le débugger je n'ai aucun souci, je peux utiliser mes méthodes sans problèmes et accéder tant que je veux à la base de données. Internet Explorer se lance à l'adresse suivante : http://localhost:1515/DSLAnalog/Service.asmx

Maintenant j'ai copié le répertoire de mon web service dans le répertoire de IIS (C:\Inetpub\wwwroot), et je tente de le lancer sur le poste en passant par l'adresse
normale :
http://MonPoste/DSLAnalog/Service.asmx

J'ai également tenter en local à l'adresse suivante :
http://localhost/DSLAnalog/Service.asmx


Mais j'ai toujours le même message d'erreur :
 

Server Error in '/DSLAnalog' Application.


Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'connectionStrings'

Source Error:

Line 51:</exceptionPolicies> 
Line 52:   </exceptionHandling> 
Line 53:   <connectionStrings>     
Line 54:     <add name="DSLAnalog" connectionString="Data Source=vtech\SQLEXPRESS;Initial Catalog=DSLAnalog;Integrated Security=True" providerName="System.Data.SqlClient" /> 
Line 55:   </connectionStrings>  


Source File: C:\Inetpub\wwwroot\DSLAnalog\web.config    Line: 53



Ma question est connaissez vous cette erreur et comment puis-je la résoudre ?
Je ne trouve pas normal que ça marche quand je lance le débugger et que ça ne marche pas quand j'essaie d'y accéder par son adresse, aurais-je un problème avec mon instance dans IIS ?

Merci d'avance chers amis

Nelson


mercredi 29 mars 2006 à 16:01:28 | Re : Pb de connection strings dans un webservice distant

neo557

Je post également une partie de mon webconfig comme cela m'avait été demandé :

<configuration>

  <configSections>

    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>

    <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>

    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>

  </configSections>

  <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">

    <listeners>

      <add fileName="trace.log" header="----------------------------------------" footer="----------------------------------------" formatter="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="FlatFile TraceListener"/>

    </listeners>

    <formatters>

      <add template="Timestamp: {timestamp}&#xA;Message: {message}&#xA;Category: {category}&#xA;Priority: {priority}&#xA;EventId: {eventid}&#xA;Severity: {severity}&#xA;Title:{title}&#xA;Machine: {machine}&#xA;Application Domain: {appDomain}&#xA;Process Id: {processId}&#xA;Process Name: {processName}&#xA;Win32 Thread Id: {win32ThreadId}&#xA;Thread Name: {threadName}&#xA;Extended Properties: {dictionary({key} - {value}&#xA;)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Text Formatter"/>

    </formatters>

    <categorySources>

      <add switchValue="All" name="General">

        <listeners>

          <add name="FlatFile TraceListener"/>

        </listeners>

      </add>

    </categorySources>

    <specialSources>

      <allEvents switchValue="All" name="All Events"/>

      <notProcessed switchValue="All" name="Unprocessed Category"/>

      <errors switchValue="All" name="Logging Errors &amp; Warnings">

        <listeners>

          <!--<add name="FlatFile TraceListener" />-->

        </listeners>

      </errors>

    </specialSources>

  </loggingConfiguration>

  <exceptionHandling>

    <exceptionPolicies>

      <add name="WebImageViewer Policy">

        <exceptionTypes>

          <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=******" postHandlingAction="NotifyRethrow" name="Exception">

            <exceptionHandlers>

              <add logCategory="General" eventId="100" severity="Error" title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Logging Handler"/>

            </exceptionHandlers>

          </add>

        </exceptionTypes>

      </add>

    </exceptionPolicies>

  </exceptionHandling>

  <connectionStrings>   

    <add name="DSLAnalog" connectionString="Data Source=vtech\SQLEXPRESS;Initial Catalog=DSLAnalog;Integrated Security=True" providerName="System.Data.SqlClient" />

  </connectionStrings> 

       <appSettings/>

       <system.web>

             <compilation debug="true">

                    <assemblies>

                           <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=*****"/>

                           <add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=*****"/>

                           <add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=*****"/>

                           <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=*****"/>

                           <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=******"/>

                           <add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=*****"/></assemblies></compilation>

             <!--

            The <authentication> section enables configuration

            of the security authentication mode used by

            ASP.NET to identify an incoming user.

        -->

             <authentication mode="Windows"/>

             <!--

            The <customErrors> section enables configuration

            of what to do if/when an unhandled error occurs

            during the execution of a request. Specifically,

            it enables developers to configure html error pages

            to be displayed in place of a error stack trace.

 

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

            <error statusCode="403" redirect="NoAccess.htm" />

            <error statusCode="404" redirect="FileNotFound.htm" />

        </customErrors>

        -->

       </system.web>

</configuration>

Vraiment désolé d'acoir été obligé de réediter le post.


jeudi 30 mars 2006 à 01:09:00 | Re : Pb de connection strings dans un webservice distant

gyzmo222

Essaye de changer ton tag custom error à la fin

<customErrors mode="Off"></customErrors>

eu lieu de

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

            <error statusCode="403" redirect="NoAccess.htm" />

            <error statusCode="404" redirect="FileNotFound.htm" />

        </customErrors>


jeudi 30 mars 2006 à 08:40:54 | Re : Pb de connection strings dans un webservice distant

neo557

C'est fait, malheureusement ça ne change rien.

Nelson

jeudi 30 mars 2006 à 09:34:55 | Re : Pb de connection strings dans un webservice distant

neo557

J'ai modifier quelque chose dans IIS. Je me suis aperçu dans les propriétés de mon web service que l'"ASP.NET Version" était la 1.1....J'ai changé pour la 2.0. Et l'erreur à changée.

Server Error in '/DSL Analog' Application.

Failed to access IIS metabase.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

 
[HostingEnvironmentException: Failed to access IIS metabase.]
   System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3492170
   System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
   System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
   System.Web.CachedPathData.GetConfigPathData(String configPath) +382
   System.Web.CachedPathData.GetConfigPathData(String configPath) +243
   System.Web.CachedPathData.GetApplicationPathData() +68
   System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3385679
   System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig

J'ai tenté la manipulation décrite sur le lien que renvoi ce message d'erreur. J'ai télécharger le "metaacl.exe" l'ai installé puis j'ai lancer la ligne de commande écrite sur le site, mais rien n'y fait l'erreur ne bouge pas...

Nelson

jeudi 30 mars 2006 à 12:56:24 | Re : Pb de connection strings dans un webservice distant

neo557

Ok ben j'ai trouvé ce qui n'allait pas. C'est tout simplement mon installation de IIS qui n'était pas complète. Si ça arrive a qqun vérifier bien que vous avez tous les composants de IIS installés.

Nelson




Cette discussion est classé dans : service, error, line, webservice, dslanalog


Répondre à ce message

Sujets en rapport avec ce message

Mozilla et webservice [ par pma3d ] Voilà, comme je me suis pris la tête avec ce problème pendant pas mal de temps, et que je viens de découvrir par hasard ce qui le provoquait, je me su WebService [ par RMI ] Bonjour,Le serveur proxi de mon entreprise me pose quelque soucis  lorsque j'interroge un service web sur le net. Voilà l'erreur qui m'ait retournée.  Passage d'argument WebService - Synchronization Framework [ par braxivamov ] Bonjour, Je developpe en ce moment une application de synchronisation de données en utilisant le Microsoft Synchronization F