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

Windows Communication Foundation .NET Discussion :

error 405 method not allowed


Sujet :

Windows Communication Foundation .NET

  1. #1
    Nouveau membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2010
    Messages
    28
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2010
    Messages : 28
    Points : 25
    Points
    25
    Par défaut error 405 method not allowed
    Bonjour a tous,

    j'ai un wcf hébergé sur IIS, et lorsque j'appel une méthode de ce web service depuis une application windows mobile j'ai une erreur
    error 405 method not allowed
    j'accède au wcf en utilisant IE de l'émulateur http://ip/site/service.svc

    at system.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
    at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
    at System.ServiceModel.Channels.RequestChannel.Request(Message message)\r\n
    at Microsoft.Tools.ServiceModel.CFClientBase`1.getReply(Message msg)\r\n at Microsoft.Tools.ServiceModel.CFClientBase`1.Invoke[TREQUEST,TRESPONSE](CFInvokeInfo info, GetUpdateInfoRequest request)\r\n
    at UpdateServiceClient.GetUpdateInfo(GetUpdateInfoRequest request)
    at UpdateServiceClient.GetUpdateInfo(String appName, String maj, String min)
    at SmartDeviceProject1.Form1.btCheck_Click(Object sender, EventArgs e)
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
    at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
    at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
    at System.Windows.Forms.Application.Run(Form fm)
    at SmartDeviceProject1.Program.Main()\r\n"
    voici 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
     
    	<services>
       <service behaviorConfiguration="ServiceBehavior" name="WSUpdate.UpdateService">
        <endpoint address="http://localhost/updateservicesite/"
         binding="basicHttpBinding" contract="WSUpdate.IUpdateService" />
        <endpoint binding="wsHttpBinding" bindingConfiguration="" contract="WSUpdate.IUpdateService" />
        <host>
         <baseAddresses>
          <add baseAddress="http://localhost/updateservicesite/" />
         </baseAddresses>
        </host>
       </service>
      </services>
    		<behaviors>
    			<serviceBehaviors>
    				<behavior name="ServiceBehavior">
    					<serviceMetadata httpGetEnabled="true"/>
    					<serviceDebug includeExceptionDetailInFaults="true"/>
    				</behavior>
    			</serviceBehaviors>
    		</behaviors>
    j'espère que vous pourrais m'aider parce que la je sais pas quoi faire

    merci

  2. #2
    Membre confirmé
    Avatar de topolino
    Profil pro
    Inscrit en
    Juillet 2003
    Messages
    1 901
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2003
    Messages : 1 901
    Points : 637
    Points
    637
    Par défaut
    Tu accedes a ce service via javascript ? en rest ?
    MCTS Microsoft.
    La conception : Prendre le temps pour gagner du temps.

  3. #3
    Nouveau membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2010
    Messages
    28
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2010
    Messages : 28
    Points : 25
    Points
    25
    Par défaut
    J'essaye juste de faire appel à une méthode du service depuis une application windows mobile

    j'ai utilise l'utilitaire netCFSvcUtil pour générer les deux classes que j'ai ensuite ajouté a mon projet mobile

    et après l'appel mon service

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    UpdateServiceClient client = new UpdateServiceClient();
    client.GetUpdateInfo();
    mai ca me génère l'erreur citée au dessus

  4. #4
    Nouveau membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2010
    Messages
    28
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2010
    Messages : 28
    Points : 25
    Points
    25
    Par défaut
    J'ai fait des test à partir de mon application winForm j'avais dit que cela marché en localhost, par contre si je remplace le localhost par l'ip de ma machine ca ne marche plus, j'ai toujours cette erreur (405) method not allowed

    j'ai pourtant ajouté cela a mon web.confg

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    <basicHttpBinding>
        <binding name="binding">
         <security mode="None">
          <transport clientCredentialType="None"/>
         </security>
        </binding>
    </basicHttpBinding>
    Y a quelqu'un qui peut me filer un coup de main?

  5. #5
    Nouveau membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2010
    Messages
    28
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2010
    Messages : 28
    Points : 25
    Points
    25
    Par défaut
    Bon je me réponds à moi même peut être que ca servira à quelqu'un un jour

    voila comment j'ai remédié au problème, dans le web.config du service
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <endpoint address="basic" binding="basicHttpBinding"
         bindingConfiguration="binding" contract="WebService_Update.IUpdate" />
    et dans le fichier du proxy généré par NetCFSvcUtil, à l'endroit où est déclaré le endpoint

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://ippc/UpdateSite/ServiceUpdate.svc/basic
    Mais je me demande quand même comment ca se fait que certains arrivent à utiliser leur service sans renseigner le .svc dans l'adresse

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Unexpected HTTP status 405 "Method Not Allowed"
    Par jeff0123 dans le forum Subversion
    Réponses: 0
    Dernier message: 10/02/2014, 09h32
  2. Réponses: 6
    Dernier message: 21/04/2011, 14h56
  3. [XMLHttpRequest] Post : 405 Method Not Allowed ?
    Par themoye dans le forum 1&1
    Réponses: 0
    Dernier message: 27/09/2010, 18h00
  4. Erreur 405 Method Not Allowed
    Par vorjan dans le forum Langage
    Réponses: 2
    Dernier message: 26/04/2009, 08h19
  5. [PHP-JS] Method Not Allowed sur index.html
    Par metatron dans le forum Langage
    Réponses: 3
    Dernier message: 10/08/2006, 12h07

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