asmx

Calling .asmx webservice from jQuery: GET is not allowed?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 18:09:59
问题 I have a simple page. On load, it calls a web service, and then I get the following error: an attempt was made to call the method using a GET request, which is not allowed My JS-code: function getTutors() { var url = '<%= ResolveUrl("~/services/tutorservice.asmx/gettutors") %>'; $.ajax({ type: "GET", data: "{'data':'" + 'test-data' + "'}", url: url, contentType: "application/json; charset=utf-8", dataType: "json", success: function (d) { alert('succes'); return d; }, error: function () {

hosting the application in iis cascading dropdown with ajax is display the method 500 error?

二次信任 提交于 2019-12-24 16:24:27
问题 I am using cascading dropdownExtender in my application it is working on local system but i am hosting IIS not working display the method 500 error what is the problem pls give me suggestion. Thanku hemanth 回答1: I could findout my answer , first debugging the asmx page i could findout the duplication dlls in my application, i deleted that one it is working fine . 回答2: In above question problem is first i hosted in iis that time the folder cascading drop down extender code dll is adding

Resolve a System.Web.Services.WebService instance with Castle (for AOP purposes)

风流意气都作罢 提交于 2019-12-24 15:53:32
问题 I wanted to implement logging for an existing web service with an interceptor; in the project we're using a System.Web.Services.WebService class (those associated with asmx.cs files), but all the examples I've found online use the castle's wcf facility. Is there a way to register and resolve a System.Web.Services.WebService instance with Castle? 回答1: I doubt you can proxy an asmx WebService. IIRC the model for asmx web services is similar to ASP.NET WebForms, so the same limitations apply. 来源

calling asmx web service from jQuery

陌路散爱 提交于 2019-12-24 15:43:46
问题 I am not able to call web service(asmx) from jQuery function. It is saying "access denied" error while calling web service. It is working in the dev and local machine but I am getting the same error. Here is my ajax call $.ajax({ type: "POST", url: "http://server.com/calculator.asmx/calculus", data: "{ 'userID': '" + $("#usrid").val() + "','password': '" + $("#password").val() + "' }", contentType: "application/json; charset=utf-8", dataType: "json", success: Success, error: Error }); My web

ASMX Object -> Proxy Object Conversion

元气小坏坏 提交于 2019-12-24 11:28:20
问题 Is there a way to convert an instance of an object to an instance of a web service proxy of the same type? It seems like this is something .NET has to be capable of under the hood, so I'm just trying to find and re-use this function. It's definitely a little awkward, but I have access to both types in my project through a common library, and it would be very convenient for my purposes to be able to work with the real object, and then convert it to the proxy type at the last minute before

Server was unable to process request. The specified security token is invalid

淺唱寂寞╮ 提交于 2019-12-24 10:37:53
问题 Here is my code: DefectsService.DefectHandler dh = new DefectsService.DefectHandler(); dh.Url = "https://myUrl.com/defectservice.asmx"; DefectsService.Defect defect = new DefectsService.Defect(); defect.Name = "some name"; int noDefect = dh.AddDefect(myGuid, defect); I'm adding a web reference with one URL, which then I change in the second line of the code above. The new URL is correct. But, when it comes to the last line I get the error "Server was unable to process request. The specified

asmx web services and key value parameters

元气小坏坏 提交于 2019-12-24 09:43:14
问题 I currently have an asmx method defined like so : [WebMethod] public String Method1(Hashtable form) It receives json objects with a variable number of attributes, for example : {"form":{"name1":"10","name2":"20"}} This is working fine and gives the expected results when called, but when I open the web service address in the browser, I get the error : The type System.Collections.Hashtable is not supported because it implements IDictionary I've tried other data types, like List<DictionaryEntry>

turn on IncludeExceptionDetailInFaults

点点圈 提交于 2019-12-24 08:47:25
问题 I am using asmx webservice that work in some cases and getting exception : System.ServiceModel.FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and

Why cant a web service return a dictionary?

只愿长相守 提交于 2019-12-24 08:16:00
问题 I have an ASMX web service that returns a dictionary but get an error each time it is posting type System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[BL.Customer, BL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] is not supported because it implements IDictionary 回答1: Best to post the error you are actually recieving but as it goes....... IDictionaries are not supported by web services by default so

Calling asp.net webmethod with params from jquery errors

帅比萌擦擦* 提交于 2019-12-24 05:57:39
问题 I managed to setup a simple webmethod which i called from jquery and sure enough it returns ... then i added parameters on the method and added the params to jquery but it errors with Message":"Invalid JSON primitive: one.","StackTrace":" my signature on my webmethod is like so [WebMethod] public static string GetDate(string one, string two) { return "yes"; } and my jquery is like this, what am i doing wrong? $.ajax({ type: "POST", url: "MyService.aspx/GetDate", data: { one: "value", two: