IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Silverlight Discussion :

Custom tool error: Failed to generate code for the service reference


Sujet :

Silverlight

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 207
    Points : 60
    Points
    60
    Par défaut Custom tool error: Failed to generate code for the service reference
    Bonjour,
    Je pouvais compiler mon projet sans la moindre erreur, j'ai tenté d'ajouter une fonction dans mon sercice wcf, je l'ai lancé dans le navigateur, j'ai fait un update.
    Depuis, j'ai une erreur :
    Error 17 Custom tool error: Failed to generate code for the service reference 'MonService'. Please check other error and warning messages for details. E:\SilverlightApplication2\SilverlightApplication2\Service References\MonService\Reference.svcmap 1 1 SilverlightApplication2
    J'ai alors supprimé la fonction que je venais de créer mais toujours la même erreur, mon service n'est plus reconnu.

    Est ce quelqu'un pourrait m'aider?

    Merci.

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 207
    Points : 60
    Points
    60
    Par défaut
    Lorsque je lance mon service dans mon naviguteur je n'ai pas d'erreur :
    You have created a service.

    To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax: ...
    J'ai une erreur dans mon projet et 16 warnings :

    (11 fois celui ci)
    Custom tool warning: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
    Custom tool warning: Cannot import wsdl:portType
    Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
    Error: Exception has been thrown by the target of an invocation.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IServiceWCF']
    Warning 13 Custom tool warning: Cannot import wsdl:binding
    Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
    XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IServiceWCF']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_IServiceWCF']
    Warning 14 Custom tool warning: Cannot import wsdl:port
    Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
    XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_IServiceWCF']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='ServiceWCF']/wsdl:port[@name='BasicHttpBinding_IServiceWCF']

    Custom tool warning: No endpoints compatible with Silverlight 3 were found. The generated client class will not be usable unless endpoint information is provided via the constructor.
    Custom tool warning: Exception has been thrown by the target of an invocation.


    Je n'ai jamais modifié mon web.config comme cela fonctionnait au départ.

    Le voici :
    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
    <?xml version="1.0"?>
    <configuration>
     
        <connectionStrings>
            <add name="****" connectionString="Data Source=*****;Initial Catalog=****;Persist Security Info=True;User ID=****;Password=****"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
        <system.web>
            <compilation debug="true" targetFramework="4.0" />
        </system.web>
        <system.webServer>
          <modules runAllManagedModulesForAllRequests="true"/>
        </system.webServer>
     
        <system.serviceModel>
            <behaviors>
                <serviceBehaviors>
                    <behavior name="">
                        <serviceMetadata httpGetEnabled="true" />
                        <serviceDebug includeExceptionDetailInFaults="false" />
                    </behavior>
                </serviceBehaviors>
            </behaviors>
        </system.serviceModel>
    </configuration>

  3. #3
    Expert éminent sénior
    Avatar de Skyounet
    Homme Profil pro
    Software Engineer
    Inscrit en
    Mars 2005
    Messages
    6 380
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : Etats-Unis

    Informations professionnelles :
    Activité : Software Engineer
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2005
    Messages : 6 380
    Points : 13 380
    Points
    13 380
    Par défaut
    Y'a pas de endpoint dans ton web.config.

    Supprimer la partie <system.serviceModel> de ton web.config.
    Supprime ton service et recrée le.
    Introduction à Silverlight 4 (new) ; Localisation d'une application Silverlight (new) ;
    Mon espace perso[/B]

    La connaissance s’acquiert par l’expérience, tout le reste n’est que de l’information. Albert Einstein[/SIZE]

  4. #4
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 207
    Points : 60
    Points
    60
    Par défaut
    J'ai supprimé mon service puis je l'ai rajouté sous un autre nom, et la plus aucunne erreur.
    Je n'ai pas modifié mon web.config
    C'est vraiment bizarre cette erreur.
    ça peut venir d'où?

  5. #5
    Expert éminent sénior
    Avatar de Skyounet
    Homme Profil pro
    Software Engineer
    Inscrit en
    Mars 2005
    Messages
    6 380
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : Etats-Unis

    Informations professionnelles :
    Activité : Software Engineer
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2005
    Messages : 6 380
    Points : 13 380
    Points
    13 380
    Par défaut
    Citation Envoyé par maxwel56 Voir le message
    J'ai supprimé mon service puis je l'ai rajouté sous un autre nom, et la plus aucunne erreur.
    Je n'ai pas modifié mon web.config
    C'est vraiment bizarre cette erreur.
    ça peut venir d'où?
    Erreur de config.
    Sans endpoint dans le web.config ça ne peut pas fonctionner.
    Introduction à Silverlight 4 (new) ; Localisation d'une application Silverlight (new) ;
    Mon espace perso[/B]

    La connaissance s’acquiert par l’expérience, tout le reste n’est que de l’information. Albert Einstein[/SIZE]

  6. #6
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 207
    Points : 60
    Points
    60
    Par défaut
    ba j'en ai toujours pas et ça fonctionne

  7. #7
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 207
    Points : 60
    Points
    60
    Par défaut
    S'il faut ajouter quelque chose, j'aimerais savoir quoi, je débute en silverlight.

  8. #8
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 207
    Points : 60
    Points
    60
    Par défaut
    J'ai essayé d'ajouter un endpoint comme vous me l'avez conseiller, mais du coup plus rien ne fonctionne, pouvez vous m'aidez?

  9. #9
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2009
    Messages : 207
    Points : 60
    Points
    60
    Par défaut
    Voici mon web.config
    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
    35
    36
    37
    38
    39
    <?xml version="1.0"?>
    <configuration>
        <connectionStrings>
            <add name="*****" connectionString="Data Source=****;Initial Catalog=****;Persist Security Info=True;User ID=****;Password=****" providerName="System.Data.SqlClient" />
        </connectionStrings>
        <system.web>
          <httpRuntime executionTimeout="999999" maxRequestLength="2097151"/>
          <customErrors mode="Off"/>
          <compilation debug="true" targetFramework="4.0"/>
          <identity impersonate="true"/>
          <authentication mode="Windows"/>
        </system.web>
        <system.webServer>
          <!--<modules runAllManagedModulesForAllRequests="true"/> -->
        </system.webServer>
      <system.serviceModel>
        <client>
          <endpoint address="" binding="basicHttpBinding" contract="SilverlightApplication2_Web.IServiceWCF">
            <identity>
              <dns value="localhost"/>
            </identity>
          </endpoint>
        </client>
        <behaviors>
          <serviceBehaviors>
            <behavior name="SilverlightApplication2_Web.ServiceWCFBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service behaviorConfiguration="SilverlightApplication2_Web.ServiceWCFBehavior" name="SilverlightApplication2_Web.ServiceWCF">
            <endpoint address="" binding="basicHttpBinding" contract="SilverlightApplication2_Web.ServiceWCF"/>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
        </services>
      </system.serviceModel>
    </configuration>

  10. #10
    Membre du Club
    Étudiant
    Inscrit en
    Février 2009
    Messages
    55
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2009
    Messages : 55
    Points : 49
    Points
    49
    Par défaut
    svp
    j'ai le même erreur, la référence de mon service n'est pas reconnus !!
    je travail avec Silverlight 4
    y t il d'autres changements à faire ??

    voici la partie service ds le Web.config

    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
     <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <customBinding>
            <binding name="FCTest.Web.Service1.customBinding0">
              <binaryMessageEncoding />
              <httpTransport />
            </binding>
          </customBinding>
        </bindings>
        <services>
          <service name="FCTest.Web.Service1">
            <endpoint address="" binding="customBinding" bindingConfiguration="FCTest.Web.Service1.customBinding0"
              contract="FCTest.Web.Service1" />
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
          multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
    les warnings :

    Custom tool warning: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

    Custom tool warning: Cannot import wsdl:portType
    Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
    Error: Exception has been thrown by the target of an invocation.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='']/wsdl:portType[@name='Service1']

    Custom tool warning: Cannot import wsdl:binding
    Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
    XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='']/wsdl:portType[@name='Service1']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='CustomBinding_Service1']

    Custom tool warning: Cannot import wsdl:port
    Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
    XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='CustomBinding_Service1']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='Service1']/wsdl:port[@name='CustomBinding_Service1']

    Custom tool warning: No endpoints compatible with Silverlight 4 were found. The generated client class will not be usable unless endpoint information is provided via the constructor.
    et une erreur

    Custom tool error: Failed to generate code for the service reference 'ServiceReference1'. Please check other error and warning messages for details.
    voilà!!
    débutante en SL et en Webservices, je suis assez perdue !! je veux bien comprendre ce qui ce passe

    merci d'avance

  11. #11
    Membre habitué
    Profil pro
    Inscrit en
    Septembre 2008
    Messages
    121
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2008
    Messages : 121
    Points : 135
    Points
    135
    Par défaut
    Custom tool warning: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
    Y'a un problème de Serialisation dans ton service a mon avis, des types non sérialisables que tu essayes de retourner ou des attribut manquant si tu as déclaré une classe dans ton service
    object reference not set to an instance of an object

  12. #12
    Membre du Club
    Étudiant
    Inscrit en
    Février 2009
    Messages
    55
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2009
    Messages : 55
    Points : 49
    Points
    49
    Par défaut
    mon application est de type Silverlight Businnes Application , dés que j'update la référence de mon service (après l'ajout d'une seule opération) la même erreur :
    Custom tool error: Failed to generate code for the service reference 'gérerFormationsServiceReference'. Please check other error and warning messages for details.
    et les warnings qui suivent , apparaissent !

    plz help me !

Discussions similaires

  1. Error 404: Resource not found for the segment
    Par jkamelin dans le forum Microsoft Dynamics CRM
    Réponses: 4
    Dernier message: 07/02/2018, 10h01
  2. error: Failed to generate code for the service reference
    Par technosmile dans le forum Silverlight
    Réponses: 2
    Dernier message: 18/12/2012, 16h38
  3. Custom tool error: Failed to generate code.
    Par jkamelin dans le forum C#
    Réponses: 2
    Dernier message: 15/09/2009, 18h18
  4. [DEBUG] Found No Interfaces. Generating Code for Types
    Par Battosaiii dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 18/08/2006, 15h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo