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

Services Web Discussion :

Method Error 500


Sujet :

Services Web

  1. #1
    Membre confirmé
    Inscrit en
    Janvier 2006
    Messages
    112
    Détails du profil
    Informations forums :
    Inscription : Janvier 2006
    Messages : 112
    Par défaut Method Error 500
    Bonsoir

    Je voudrais juste ajouter une fonctionnalité Ajax à mes cascadedropdowmenu mais à chaque fois je reçois la même erreur quand je visualize la page.
    En cherchant sur internet dans les forums de ASP.NET le seul problème qui s'opposait c'était l'absence de la balise
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <System.Web.Script.Services.ScriptService()> _
    qui existe déjà dans mon web service. En ce qui concerne les Datasets j'ai tout vérifier ça fonctionne, donc où est le problème.

    web service

    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
     
     
     
    Imports System.Web
    Imports System.Web.Services
    Imports System.Web.Services.Protocols
    Imports AjaxControlToolkit
    Imports System.Data
    Imports System.Data.SqlClient
    Imports System.Collections.Generic
     
    ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
     
    <WebService(Namespace:="http://tempuri.org/")> _
    <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
    <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
    <System.Web.Script.Services.ScriptService()> _
    Public Class CityService
        Inherits System.Web.Services.WebService
     
        <WebMethod()> _
        Public Function GetCities(ByVal knowncategorievalues As String, ByVal category As String) As CascadingDropDownNameValue()
     
            Dim cityAdapter As New dsCitiesTableAdapters.CitiesTableAdapter
     
            Dim makeValues As New List(Of CascadingDropDownNameValue)()
     
            For Each row As DataRow In cityAdapter.GetAllCities
                makeValues.Add(New CascadingDropDownNameValue(row("BranchID").ToString(), row("CityName").ToString(), row("BranchName").ToString()))
            Next
     
            Return makeValues.ToArray()
     
     
     
        End Function
     
    End Class

    la page ASPX
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
     
     
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
     
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <style type="text/css">
            .style1
            {
                text-align: center;
            }
            .style2
            {
                width: 46%;
            }
            .style4
            {
                width: 250px;
                text-align: right;
            }
            .style5
            {
                width: 1px;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div class="style1">
        <div>
     
        </div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <div class="style1">
                <br />
                <table class="style2">
                    <tr>
                        <td class="style4">
                            <span lang="en-us">City:</span></td>
                        <td class="style5">
                            &nbsp;</td>
                        <td>
                            <asp:DropDownList ID="CityDDL" runat="server" 
                                Height="16px" style="z-index: 1; margin-left: 0px" Width="146px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            <span lang="en-us">Branch Name:</span></td>
                        <td class="style5">
                            &nbsp;</td>
                        <td>
                            <asp:DropDownList ID="BranchNameDDL" runat="server" 
                                Height="16px" style="z-index: 1; margin-left: 0px" Width="146px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            <span lang="en-us">Branch ID:</span></td>
                        <td class="style5">
                            &nbsp;</td>
                        <td>
                            <asp:DropDownList ID="BranchIDDDL" runat="server"  
                                Height="16px" style="z-index: 1; margin-left: 0px" Width="146px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                </table>
                <br />
                <br />
                <br />
            </div>
        </div>
    <cc1:CascadingDropDown ID="CityCascadingDropDown" runat="server" TargetControlID ="CityDDL" Category ="City" PromptText ="Please Select Your City ..." LoadingText ="Retrieving Information" ServicePath ="CityService.asmx" ServiceMethod ="GetCities">
        </cc1:CascadingDropDown>
        </form>
     
    </body>
    </html>


    Merci

  2. #2
    Membre très actif Avatar de Sacha999
    Inscrit en
    Mars 2007
    Messages
    294
    Détails du profil
    Informations personnelles :
    Âge : 45

    Informations forums :
    Inscription : Mars 2007
    Messages : 294
    Par défaut
    Lu

    Il faut que tu corriges la signature de ta WebMethod comme ci-dessous, la casse est importante, ainsi que le nom des paramêtres. Sinon il ne retrouve plus ses billes

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    <WebMethod()> _
    <System.Web.Script.Services.ScriptMethod()> _
        Public Function GetCities(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()

Discussions similaires

  1. [AJAX] [Method error 500] sur un CascadingDropDown
    Par LaDeveloppeuse dans le forum Général JavaScript
    Réponses: 9
    Dernier message: 25/02/2009, 11h46
  2. [mod_jk] integration tomcat apache, error 500
    Par peppena dans le forum Tomcat et TomEE
    Réponses: 5
    Dernier message: 10/02/2006, 10h01
  3. [SERVLET][STRUTS]Error 500--Internal Server Error
    Par Devil666 dans le forum Struts 1
    Réponses: 7
    Dernier message: 27/06/2005, 13h07
  4. [Servlet] error 500
    Par phoebe dans le forum Servlets/JSP
    Réponses: 10
    Dernier message: 06/05/2004, 12h37
  5. redirection impossible => error 500 !
    Par alfigor dans le forum ASP
    Réponses: 4
    Dernier message: 26/04/2004, 10h02

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