Calling a WebMethod using jQueryAjax change casing









up vote
0
down vote

favorite












I have the following request using ajax (simplified):



<asp:TextBox ID="DealNumber" runat="server" Width="100px" ToolTip="Deal (aka OPG)">
</asp:TextBox>
<Ajax:AutoCompleteExtender
ID="AutoCompleteExtender2"
runat="server"
TargetControlID="DealNumber"
ServiceMethod="GetDealNumberList"
ServicePath="/ws/WebServices.asmx"/>


and on /ws/WebServices.asmx (sorry my .VB):



 <System.Web.Script.Services.ScriptMethod(UseHttpGet:=True)>
<System.Web.Services.WebMethod>
Public Function GetDealNumberList(prefixText As String, count As Integer, contextKey As String) As System.String()
return "Test " & PrefixText & " " & ContextKey
end function


Now, doing the typical F12 network trace, ajax reports:



Invalid method name 'getdealnumberlist', method names are case sensitive. The method name 'GetWTNumberList' with the same name but different casing was found.


Who and why the casing is changed? If I modify my .asmx works as intended.










share|improve this question

























    up vote
    0
    down vote

    favorite












    I have the following request using ajax (simplified):



    <asp:TextBox ID="DealNumber" runat="server" Width="100px" ToolTip="Deal (aka OPG)">
    </asp:TextBox>
    <Ajax:AutoCompleteExtender
    ID="AutoCompleteExtender2"
    runat="server"
    TargetControlID="DealNumber"
    ServiceMethod="GetDealNumberList"
    ServicePath="/ws/WebServices.asmx"/>


    and on /ws/WebServices.asmx (sorry my .VB):



     <System.Web.Script.Services.ScriptMethod(UseHttpGet:=True)>
    <System.Web.Services.WebMethod>
    Public Function GetDealNumberList(prefixText As String, count As Integer, contextKey As String) As System.String()
    return "Test " & PrefixText & " " & ContextKey
    end function


    Now, doing the typical F12 network trace, ajax reports:



    Invalid method name 'getdealnumberlist', method names are case sensitive. The method name 'GetWTNumberList' with the same name but different casing was found.


    Who and why the casing is changed? If I modify my .asmx works as intended.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have the following request using ajax (simplified):



      <asp:TextBox ID="DealNumber" runat="server" Width="100px" ToolTip="Deal (aka OPG)">
      </asp:TextBox>
      <Ajax:AutoCompleteExtender
      ID="AutoCompleteExtender2"
      runat="server"
      TargetControlID="DealNumber"
      ServiceMethod="GetDealNumberList"
      ServicePath="/ws/WebServices.asmx"/>


      and on /ws/WebServices.asmx (sorry my .VB):



       <System.Web.Script.Services.ScriptMethod(UseHttpGet:=True)>
      <System.Web.Services.WebMethod>
      Public Function GetDealNumberList(prefixText As String, count As Integer, contextKey As String) As System.String()
      return "Test " & PrefixText & " " & ContextKey
      end function


      Now, doing the typical F12 network trace, ajax reports:



      Invalid method name 'getdealnumberlist', method names are case sensitive. The method name 'GetWTNumberList' with the same name but different casing was found.


      Who and why the casing is changed? If I modify my .asmx works as intended.










      share|improve this question













      I have the following request using ajax (simplified):



      <asp:TextBox ID="DealNumber" runat="server" Width="100px" ToolTip="Deal (aka OPG)">
      </asp:TextBox>
      <Ajax:AutoCompleteExtender
      ID="AutoCompleteExtender2"
      runat="server"
      TargetControlID="DealNumber"
      ServiceMethod="GetDealNumberList"
      ServicePath="/ws/WebServices.asmx"/>


      and on /ws/WebServices.asmx (sorry my .VB):



       <System.Web.Script.Services.ScriptMethod(UseHttpGet:=True)>
      <System.Web.Services.WebMethod>
      Public Function GetDealNumberList(prefixText As String, count As Integer, contextKey As String) As System.String()
      return "Test " & PrefixText & " " & ContextKey
      end function


      Now, doing the typical F12 network trace, ajax reports:



      Invalid method name 'getdealnumberlist', method names are case sensitive. The method name 'GetWTNumberList' with the same name but different casing was found.


      Who and why the casing is changed? If I modify my .asmx works as intended.







      asp.net ajax iis asp.net-ajax






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 at 18:53









      fcm

      538718




      538718






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          Not sure what exactly causing the problem, but I experienced this issue long time ago while still using webforms page and AJAX callback to return something from web service (ASMX). I fixed this issue by putting MessageName property with method name in lowercase inside WebMethodAttribute like this example:



          <ScriptMethod(UseHttpGet:=True)>
          <WebMethod(MessageName:="getdealnumberlist")>
          Public Function GetDealNumberList(prefixText As String, count As Integer, contextKey As String) As String()
          Return "Test " & PrefixText & " " & ContextKey
          End Function


          This problem also sometimes occurred when the web service methods are tested directly, e.g. by entering URL like http://localhost:XXXX/path/to/webservicename.asmx/GetDealNumberList.






          share|improve this answer




















          • Alias is a good temporary fix, in my case I can rename the webservice, but why the call is changed from Camel to Lower.
            – fcm
            Nov 12 at 17:19

















          up vote
          0
          down vote



          accepted










          In this annoying issue, I found the answer and it was very trivial.



          In Visual Studio, when using Option Compare Binary Option Compare Text I was under the impression that will only affect code generation. I was wrong. Not sure what is the method to create the intermediate code for Web Services and/or AJAX, but, adding Option Compare Text fix the camel issue.



          I personally think this is a (survivable) bug.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53252052%2fcalling-a-webmethod-using-jqueryajax-change-casing%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            Not sure what exactly causing the problem, but I experienced this issue long time ago while still using webforms page and AJAX callback to return something from web service (ASMX). I fixed this issue by putting MessageName property with method name in lowercase inside WebMethodAttribute like this example:



            <ScriptMethod(UseHttpGet:=True)>
            <WebMethod(MessageName:="getdealnumberlist")>
            Public Function GetDealNumberList(prefixText As String, count As Integer, contextKey As String) As String()
            Return "Test " & PrefixText & " " & ContextKey
            End Function


            This problem also sometimes occurred when the web service methods are tested directly, e.g. by entering URL like http://localhost:XXXX/path/to/webservicename.asmx/GetDealNumberList.






            share|improve this answer




















            • Alias is a good temporary fix, in my case I can rename the webservice, but why the call is changed from Camel to Lower.
              – fcm
              Nov 12 at 17:19














            up vote
            0
            down vote













            Not sure what exactly causing the problem, but I experienced this issue long time ago while still using webforms page and AJAX callback to return something from web service (ASMX). I fixed this issue by putting MessageName property with method name in lowercase inside WebMethodAttribute like this example:



            <ScriptMethod(UseHttpGet:=True)>
            <WebMethod(MessageName:="getdealnumberlist")>
            Public Function GetDealNumberList(prefixText As String, count As Integer, contextKey As String) As String()
            Return "Test " & PrefixText & " " & ContextKey
            End Function


            This problem also sometimes occurred when the web service methods are tested directly, e.g. by entering URL like http://localhost:XXXX/path/to/webservicename.asmx/GetDealNumberList.






            share|improve this answer




















            • Alias is a good temporary fix, in my case I can rename the webservice, but why the call is changed from Camel to Lower.
              – fcm
              Nov 12 at 17:19












            up vote
            0
            down vote










            up vote
            0
            down vote









            Not sure what exactly causing the problem, but I experienced this issue long time ago while still using webforms page and AJAX callback to return something from web service (ASMX). I fixed this issue by putting MessageName property with method name in lowercase inside WebMethodAttribute like this example:



            <ScriptMethod(UseHttpGet:=True)>
            <WebMethod(MessageName:="getdealnumberlist")>
            Public Function GetDealNumberList(prefixText As String, count As Integer, contextKey As String) As String()
            Return "Test " & PrefixText & " " & ContextKey
            End Function


            This problem also sometimes occurred when the web service methods are tested directly, e.g. by entering URL like http://localhost:XXXX/path/to/webservicename.asmx/GetDealNumberList.






            share|improve this answer












            Not sure what exactly causing the problem, but I experienced this issue long time ago while still using webforms page and AJAX callback to return something from web service (ASMX). I fixed this issue by putting MessageName property with method name in lowercase inside WebMethodAttribute like this example:



            <ScriptMethod(UseHttpGet:=True)>
            <WebMethod(MessageName:="getdealnumberlist")>
            Public Function GetDealNumberList(prefixText As String, count As Integer, contextKey As String) As String()
            Return "Test " & PrefixText & " " & ContextKey
            End Function


            This problem also sometimes occurred when the web service methods are tested directly, e.g. by entering URL like http://localhost:XXXX/path/to/webservicename.asmx/GetDealNumberList.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 12 at 1:39









            Tetsuya Yamamoto

            13.9k41939




            13.9k41939











            • Alias is a good temporary fix, in my case I can rename the webservice, but why the call is changed from Camel to Lower.
              – fcm
              Nov 12 at 17:19
















            • Alias is a good temporary fix, in my case I can rename the webservice, but why the call is changed from Camel to Lower.
              – fcm
              Nov 12 at 17:19















            Alias is a good temporary fix, in my case I can rename the webservice, but why the call is changed from Camel to Lower.
            – fcm
            Nov 12 at 17:19




            Alias is a good temporary fix, in my case I can rename the webservice, but why the call is changed from Camel to Lower.
            – fcm
            Nov 12 at 17:19












            up vote
            0
            down vote



            accepted










            In this annoying issue, I found the answer and it was very trivial.



            In Visual Studio, when using Option Compare Binary Option Compare Text I was under the impression that will only affect code generation. I was wrong. Not sure what is the method to create the intermediate code for Web Services and/or AJAX, but, adding Option Compare Text fix the camel issue.



            I personally think this is a (survivable) bug.






            share|improve this answer


























              up vote
              0
              down vote



              accepted










              In this annoying issue, I found the answer and it was very trivial.



              In Visual Studio, when using Option Compare Binary Option Compare Text I was under the impression that will only affect code generation. I was wrong. Not sure what is the method to create the intermediate code for Web Services and/or AJAX, but, adding Option Compare Text fix the camel issue.



              I personally think this is a (survivable) bug.






              share|improve this answer
























                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                In this annoying issue, I found the answer and it was very trivial.



                In Visual Studio, when using Option Compare Binary Option Compare Text I was under the impression that will only affect code generation. I was wrong. Not sure what is the method to create the intermediate code for Web Services and/or AJAX, but, adding Option Compare Text fix the camel issue.



                I personally think this is a (survivable) bug.






                share|improve this answer














                In this annoying issue, I found the answer and it was very trivial.



                In Visual Studio, when using Option Compare Binary Option Compare Text I was under the impression that will only affect code generation. I was wrong. Not sure what is the method to create the intermediate code for Web Services and/or AJAX, but, adding Option Compare Text fix the camel issue.



                I personally think this is a (survivable) bug.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 21 at 12:46

























                answered Nov 20 at 21:40









                fcm

                538718




                538718



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53252052%2fcalling-a-webmethod-using-jqueryajax-change-casing%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Barbados

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    Node.js Script on GitHub Pages or Amazon S3