asmx

Hiding the stacktrace for an exception returned by a asp.net WebMethod?

一曲冷凌霜 提交于 2021-02-08 04:41:42
问题 I am using methods with the Attribute [WebMethod] in my aspx pages. I don't use any asp.net ajax but jQuery to call these methods and return objects in JSON. This all works fine. Next I added an authorization check inside the webMethod, if the current user doesn't have access to the feature I need to let the calling JavaScript know. So I am throwing an AccessViolationException exception which can then be parsed by the OnError callback function in JavaScript. This works too but the exception

Create HTML table out of object array in Javascript

﹥>﹥吖頭↗ 提交于 2021-02-04 21:13:38
问题 I am calling a web Method from javascript. The web method returns an array of customers from the northwind database. The example I am working from is here: Calling Web Services with ASP.NET AJAX I dont know how to write this javascript method: CreateCustomersTable This would create the html table to display the data being returned. Any help would be appreciated. My javascript function GetCustomerByCountry() { var country = $get("txtCountry").value; AjaxWebService.GetCustomersByCountry(country

Create HTML table out of object array in Javascript

自古美人都是妖i 提交于 2021-02-04 21:12:21
问题 I am calling a web Method from javascript. The web method returns an array of customers from the northwind database. The example I am working from is here: Calling Web Services with ASP.NET AJAX I dont know how to write this javascript method: CreateCustomersTable This would create the html table to display the data being returned. Any help would be appreciated. My javascript function GetCustomerByCountry() { var country = $get("txtCountry").value; AjaxWebService.GetCustomersByCountry(country

ASP.Net web service - any way to disable the “Test/invoke” section?

扶醉桌前 提交于 2021-02-04 19:42:27
问题 I want to remove the "Test... Invoke" section from the top of my web service pages (partly because the word 'test' may make users mistakenly think they are not executing something in production when they click it!), but still allow HTTPGET/POST for API users. Any idea how? 回答1: Try add follow text in Web.Config (I checked it - in my test-case it works) <system.web> <webServices> <protocols> <remove name="Documentation" /> </protocols> </webServices> </system.web> http://msdn.microsoft.com/en

How to consume soap web service (.asmx) secure by basic authentication using jQuery?

霸气de小男生 提交于 2021-01-29 21:40:27
问题 I am trying to call a (.asmx) soap web service that require basic authentication using jQuery (or anything that would work). And how to pass parameters to the (.asmx) soap web service I've not been able to come up with any answers on Google. Is it possible? 回答1: OK, Finally I was able to resolve this issue :) I was searching in the wrong direction, I was looking how to open the URL secured by basic authentication using $.Ajax, where I should search for consuming SOAP service from JavaScript

ASMX web proxy class changing class name from PascalCase to camelCase - visual studio 2019

会有一股神秘感。 提交于 2021-01-29 09:10:07
问题 We had a legacy asmx web service (2.0 framework) which were migrated to 4.8 framework. [WebMethod] public virtual GetCreditPolicyResponse GetCreditPolicy(GetCreditPolicy getCreditPolicy) { return organisationStrategy.GetCreditPolicy(getCreditPolicy); } Class definition : public class GetCreditPolicy { public GetCreditPolicy(); public int RecognitionId { get; set; } } Now while we are generating the wsdl of this we are getting the following : <s:element name="GetCreditPolicy"> <s:complexType>

Cache object with ObjectCache in .Net with expiry time

假如想象 提交于 2020-08-02 06:51:00
问题 I am stuck in a scenario. My code is like below : Update : its not about how to use data cache, i am already using it and its working , its about expanding it so the method don't make call between the time of expiry and getting new data from external source object = (string)this.GetDataFromCache(cache, cacheKey); if(String.IsNullOrEmpty(object)) { // get the data. It takes 100ms SetDataIntoCache(cache, cacheKey, object, DateTime.Now.AddMilliseconds(500)); } So user hit the cache and get data

How to add token authentication to web services for “Auth-Token”?

五迷三道 提交于 2020-07-17 08:54:26
问题 I'm newer to web services, but I have a web service that I'm consuming/wrapping in Visual Studio C# that ends in Service.asmx where I did Add Service Reference and it pulled in all of the elements that were showing in Service.asmx?wsdl . It has objects for Username and Password that worked fine, but now the company who created this web service is changing to token authentication where I get a GUID token and pass null to these elements. Well shouldn't the web service show a new element where I

How to add token authentication to web services for “Auth-Token”?

你。 提交于 2020-07-17 08:53:20
问题 I'm newer to web services, but I have a web service that I'm consuming/wrapping in Visual Studio C# that ends in Service.asmx where I did Add Service Reference and it pulled in all of the elements that were showing in Service.asmx?wsdl . It has objects for Username and Password that worked fine, but now the company who created this web service is changing to token authentication where I get a GUID token and pass null to these elements. Well shouldn't the web service show a new element where I

Read XML, different number of nodes

萝らか妹 提交于 2020-04-30 07:20:43
问题 When I am reading an XML file in VB.NET (ASMX webservice), on some occasion, some node may be missing. My code is the following: nodetype = node("type").InnerText nodetime = node("time").InnerText nodefileName = node("fileName").InnerText And I've thought about this condition to see if the node exists or not. If it does not exist it returns a string with 0. If node("fileName")Is Nothing Then nodefileName = "0" Else nodefileName = nodefileName = node("fileName").InnerText. End If Instead of