asmx

JSON can call method in .aspx file but not in .asmx (ASP.NET web service) file

I am using JQuery & JSON (POST) to call webmethod. However I can call only webmethod located at aspx file but not in asmx file Below are sample codes CustomValidate.asmx Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.ComponentModel Public Class CustomValidate Inherits System.Web.Services.WebService ...

Passing generic type of webmethod

im passing a array of KeyValuePair<string,string>[] how ever when it get to my sliverlight client it turns into {web service name}.KeyValuePairOfStringString and i cant get the values from it. any one got any ideas how i can access the key and value propties? ...

Test Credentials to access a web page

Is there a nice and tested piece of code out there that I can use for this purpose: get the user/pass and the address of a web service (asmx page) and check if the user/pass are valid or not. I think I should use HTTPRequest,etc to do that but I do not have a good knowledge on that topic , causing my current method to not working prope...

Test to see if User/Pass entered for a WebService are correct or not

Possible Duplicate: Test Credentials to access a web page Hi, I need to Test to see if User/Pass entered to access a WebService are correct or not and show the proper message to the user if he has entered invalid user/pass. Is there a nice and tested piece of code out there that I can use? Thanks for help. ...

Proper error handling with 2.0 style and WCF proxies

Microsoft has provided surprisingly small amounts of information regarding this issue or I do not know enough about the problem to locate the documentation. When consuming web services using the traditional VS2005 and .NET 2.0 web service proxies, aside from FaultExceptions, what sort of communication exceptions can be thrown and throu...

Returning JSON from ASMX, and handling it correctly in Javascript

I realize there are tonnes of similar questions already up here but I cannot figure this one out. I have a Web Service (C#, .net 3.5). The essential Code you need to know of is as follows: [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptS...

How to access web service on port other than 80 in vs2008/2010

Hi all, I tried searching the net, also tried some workarounds I found (like manually executing wsdl.exe) but still I can't access a remote web service running on a port different than 80 (say 1234). When from Visual Studio 2008 OR 2010 I add a web reference using a url like http://192.168.1.2:1234/WebServices/Test.asmx, the service ...

Upgrade to .net 4 produces breaks webservice .asmx

I was trying upgrading to .net 4 for my WebForms asp.net project. Now I'm getting this when I try going to the .asmx webservice. Server Error in '/' Application. Type 'Chickenweb.WebServ.WebServ' does not inherit from 'System.Web.UI.Page'. Description: An unhandled exception occurred during the execution of the current web request. Pl...

Callling business logic layer method from PageMethods

I've a static page method in web form application and I want to call method on private class level variable from it as shown below. I'm using jQuery to call the page method. private readonly ICatalogBLL _catalogBLL = new CatalogBLL(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { _catalogBLL.GetSomet...

How to abort an ASMX request based on logic in the constructor?

I have a common base class from which all my ASMX webservice classes will inherit. In the constructor, I want to do some common authentication checks; if they fail, I would like to halt processing right away (subclass's code would not get executed) and return a 401-status-code response to the caller. However, the common ASPX-like ways ...

Default exception handling in web service

In my application I am calling a web service. try { theWebService.Method(parameter); } catch (Exception e) { //This catches and logs a SoapException } When I do this the a SoapException is caught and I'm only given a one line sentence on the issue. I'm assuming the SoapException is just relaying information from the actual exce...

Excessive HTTP 401s using Windows Authentication, AJAX, ASMX and external ISA

Enviornment: ASP.NET WebForms .NET 3.5 jQuery for AJAX ASMX web services Windows Authentication SSL When we run our production web application, our AJAX calls often have 2-3 HTTP 401s before we get our HTTP 200. Is this normal? Is there something we may be doing wrong? NOTE: The calls do not fail, the 401s try until they succe...

Failed to load asmx file?

I am using the gleamtech filevistacontrol for a back-end of a website. When i load the page which contains the control i get an error that a language file could not be found. I get an 404 response when calling the webservice. The application is running on a windows server 2008. On my development machine the application is running witho...

ASMX webservices with Silverlight Async confusion

I have a silverlight 4 web app that needs to communicate with a server by accessing the ASMX web service on the server. I have a list(yes, the array), of objects that I need to send(one by one) as a parameter to the service. However looping through the list and running the method(objecttosend); will not work because I need to send then ...

Expose additional classes in ASP.NET 2.0 webservice

Consider a webmethod which exposes an abstract class: [WebMethod] public void Save(AbstractEntity obj) { // .. } There are several classes inheriting from AbstractEntity like public class Patient : AbstractEntity { // ... } Now I want to enable the webservice consumer to create a new Patient object and save it: service....

JSON .NET asmx and Flex3

Hi i wrote webservice in .net which return json string WebService(Namespace = "AndrewRowland")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService] public class Service1 : System.Web.Services.WebService { [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string HelloWorld() ...

ASMX equivalent of RegisterAsyncTask

When an ASPX page needs to make a call to a potentially long-running operation (lengthy DB query, call to a remote webservice, etc.), I use RegisterAsyncTask, so the IIS worker thread is returned to the pool, rather than being tied up for the duration of the long-running operation. However ASMX webservices don't have a RegisterAsyncTask...

how do you pass parameters in asmx using Flexigrid?

here's my code: $('#flex1').flexigrid({ method: 'POST', url: '/services/MHService.asmx/GetSurgicalHistory', dataType: 'xml', colModel: [ { display: 'Surgical Procedure', name: 'SurgicalProcedure', width: 120, sortable: true, align: 'left' }, { displa...

ASP.NET WebService ignoring return: XmlArray ElementName

This is as weird as it gets. Name given in XmlArray attrib's ElementName appears in WISDL but not in actual response. Running under 3.5 (2.0.50727 for IIS AppPool). After more detailed digging -- autogenned WSDL has different declarations for POST/GET vs SOAP responses and the diff is that they just reference the autogenned elem/type fo...

ASP.NET 4.0 - Calling a server-side method from a client side method - PageMethods

I'm trying to access a server side method from a client side one (that is just calling a server method from javascript). I'm using .NET 4.0 Visual Studio 2010 Ultimate. I'm building a web control (ascx). I have an ascx page (the control's html) and an ascx.cs page: The ascx is the following: <%@ Control Language="C#" AutoEventWireup="tr...