asmx

jQuery deferred AJAX & 500 server errors

喜夏-厌秋 提交于 2020-01-15 08:58:01
问题 Trying to figure out how to debug generic 500 errors from my .ASMX JS: function TestError() { return $.ajax({ type: "POST", url: 'Order.asmx/TestError', contentType: "application/json; charset=utf-8" }); } $.when(TestError()).then(function (err) { console.log(err); }); C# [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public object TestError() { try { throw new Exception("Testing error"); } catch (Exception ex) { return ex; } } Result: It's not even logging the err argument.

Web service not returning integer data in an object [duplicate]

喜欢而已 提交于 2020-01-15 06:33:28
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: VS2003 Web Reference for a WCF Service has Extra "IdSpecified" Parameter Thanks everyone. I totally missed that. Yes, the class name is awful. I have a web service (ASMX) that returns an object which contains an array. I first define my response object: APIResponse response = new APIResponse(); Fill a datatable: dtHolder = SqlHelper.ExecuteDatatable(connstring, CommandType.StoredProcedure, strSelect, aParams);

Autocomplete with jQuery and asp.net repeater fills ID

纵然是瞬间 提交于 2020-01-15 05:18:08
问题 I have a asp:Textbox with autocomplete, the data comes from a webservice and returns Json data. When a item is selected it puts a value (the id) into a 'hidden' field and the price into another textbox . This all works fine. But when I put more or less the same code into a asp:repeater it doesn't do the autocomplete. This is a graps from my asp code: <script src="Scripts/jquery-1.4.4.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.10.custom.min.js" type="text

Dynamically invoke a web service at runtime

≯℡__Kan透↙ 提交于 2020-01-15 03:29:12
问题 I have code that allows me to dynamically call a web service at runtime for a given url, service name, method name, and arguments. The problem comes when the WSDL I am trying to compile contains the <import namespace="..." location="..."/> tag. It throws the following error: Service Description with namespace ... is missing Presumably I need to first compile the referenced WSDL from the import tag. How should I go about this keeping in mind that the referenced WSDL could also reference

WebService behind reverse proxy

旧时模样 提交于 2020-01-14 03:20:52
问题 I have a web service which is behind a reverse proxy. Now what is happening is when I try to add a web reference to test the web service then it says that it is unable to download the wsdl file. That is because when the request is sent it it is https://uat.mywebservice.com/Service/Service.asmx but when it hits the reverse proxy and then tires to download the wsdl and disco files it changes the link to http://myservice.comp.com/Service/Service.asmx?wsdl and it this is not the right link as

ASMX Web Service - Return user defined class with properties

隐身守侯 提交于 2020-01-13 03:19:12
问题 Hey, I am trying to return a user defined class from a web method. The class has properties and/or methods. Given the following web method: [WebMethod] public List<MenuItem> GetMenu() { List<MenuItem> menuItemList = new List<MenuItem>(); menuItemList.Add(new MenuItem()); menuItemList.Add(new MenuItem()); menuItemList.Add(new MenuItem()); return menuItemList; } Now, suppose this web service is consumed by adding a web reference in a newly created console application. The following code is used

The test form is only available for requests from the local machine

跟風遠走 提交于 2020-01-12 17:39:11
问题 Why is it that for some of my web-services, I get test forms so I can see the generated xml data, but for other web-services, I get a message saying The test form is only available for requests from the local machine. ? Both times, I am connecting to the URL of the web-service from a client side browser and all web-services are created with C#, .NET-3.5. 回答1: I googled for "The test form is only available for requests from the local machine." There were many results, and the consensus is to

Does .net 4.0 still support asmx

混江龙づ霸主 提交于 2020-01-10 03:45:11
问题 I Opened my .net 2.0 ASMX webservice in VS2010 and migrated to .net4.0. If i simply run my ASMX w/o changing te code to WCF format i can still run old asmx service under .net 4.0 ?? will this work as it is? My web.config file also has WSE settings what happens to this? WCF/net4.0 does not support attachments, do i need to change my asmx webmethod to return as dataset in the body and will this work? I tried running my existing asmx service using dataset as attachments in .net 4.0 and it worked

Does .net 4.0 still support asmx

若如初见. 提交于 2020-01-10 03:45:05
问题 I Opened my .net 2.0 ASMX webservice in VS2010 and migrated to .net4.0. If i simply run my ASMX w/o changing te code to WCF format i can still run old asmx service under .net 4.0 ?? will this work as it is? My web.config file also has WSE settings what happens to this? WCF/net4.0 does not support attachments, do i need to change my asmx webmethod to return as dataset in the body and will this work? I tried running my existing asmx service using dataset as attachments in .net 4.0 and it worked

How to sort a string array which includes a date in c#?

江枫思渺然 提交于 2020-01-07 09:02:46
问题 I'm not sure if this has been asked before, but I have few string array which I need to sort. The idea is to merge different string arrays and sort them by the date field which is a part of each element. I am reading back the information from sql server table. How could I go about doing something like this? An example of the data could be something like this: "TYPE|Field1|Field2|Date" "TYPE|Field1|Field2|Date" "TYPE|Field1|Field2|Date" And for the second array: "TYPE|Field1|Field2|Field3|Date