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.
asp.net ajax iis asp.net-ajax
add a comment |
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.
asp.net ajax iis asp.net-ajax
add a comment |
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.
asp.net ajax iis asp.net-ajax
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
asp.net ajax iis asp.net-ajax
asked Nov 11 at 18:53
fcm
538718
538718
add a comment |
add a comment |
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
.
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
add a comment |
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.
add a comment |
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
.
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
add a comment |
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
.
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
add a comment |
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
.
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
.
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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited Nov 21 at 12:46
answered Nov 20 at 21:40
fcm
538718
538718
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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