asmx

Force session timeout in an ASP.Net AJAX application

I have a large 1 page ASP.Net application. Much of this application has been entirely rewritten using .Net 3.5 from a previous version that was using .Net 2.0. As a result, the designers of this revision decided to put the entire page inside of an update panel (sigh). It seems that the only good part about this update panel is that it...

Call ASP.NET PageMethod/WebMethod with jQuery - returns whole page

jQuery 1.3.2, ASP.NET 2.0. Making an AJAX call to a PageMethod (WebMethod) returns the full/whole page instead of just the response. A breakpoint on the page method shows it's never getting hit. I have the [WebMethod] attribute on my method, and it is public static, returns string and accepts no params. I even tried adding [ScriptSer...

asmx .net 2.0 web service

i created a web service, upload it to my site on a remote server. i tried to browse it but i cant, i also tried to add web reference to his adress through vs08 but the same problem happened there. ...

Where am I going wrong in calling ASMX web methods from jquery?

I have a simple webmethod on an asp.net 2.0 application (using the 1.0 extensions not the 3.5 ajax extensions). I'm attempting to call the method from jQuery and when I do it as the countless examples show on the Internet and here on SO, I get an Internal Server Error message returned. Here's my current code: [WebMethod] [ScriptMethod...

Call an IIS Web Service without the .asmx extension

I have written a .NET web Service that is to be consumed by a client outside of my control (my server is a simulator for a live server written in PHP). The web service works as desired but the client does not have the ability to add the .asmx extension, or any extension for that matter, in their calls. They basically use http://localho...

WebService, WebMethod and Inheritance

In a Web Service context, I have the following class which inherit from the class Mammal. The Mammal class is defined in a proxy. I cannot change the definition of that class. Because I need to add some methods to the class Mammal on the client side, I inherited Mammal and created Giraffe. namespace TestApplication { public class ...

VB.Net - is it possible to return an array of object Interface's rather than an object?

I have an interface that describes an specialized list in my application... Public Interface IAlphabeticListItem Property StartingLetter() As String Property DetailsList() As Generic.List(Of DetailsData) End Interface Multiple objects implement this interface, but I want to return them in a webservice not as the underlying o...

Enable ASP.NET ASMX web service for HTTP POST / GET requests

Hi, I would like to enable a ASP.NET classic (ASMX) web service for HTTP POST and GET requests. I realise this can be done on a machine or application level by adding ... <webServices> <protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols> </webServices> .. to the machine.config or web.config. M...

Block cross domain calls to asp.net .asmx web service

Hi I've built an application that uses jQuery and JSON to consume an ASP.NET .asmx web service to perform crud operations. The application and .asmx are on the same domain. I dont mind people consuming the read operations of the .asmx remotely but dont want people randomly deleting stuff!!! I can split the methods i'd like to be publi...

WebMethod response format

I recently saw a jQuery example where a POST was made to "Default.aspx/Test", where Test was a WebMethod in Default.aspx, and the content-type for the request was "application/json". The reply from the WebMethod was in JSON. I always thought WebMethods returned SOAP responses, but if I'm interpreting this code correctly, like I said, th...

Making a SOAP Web Service call using a WebRequest

We have an ASP.Net web application which calls Web Services deployed in the same virtual directory. The call returns without any problem in the development machine. But when deployed to the production server, it gives back a '400 Bad Request' error. The call was made by creating a WebRequest and setting the SoapAction header and then W...

Using NameValueCollection in C# webservice gives not XML serializable error

I am getting this error message when I try to "Add Web Reference" to my ASMX proxy project: **"To be XML serializable, types which inherit from ICollection must have an implementation of Add(System.String) at all levels of their inheritance hierarchy. System.Collections.Specialized.NameValueCollection does not implement Add(System.St...

Static data in an ASP.NET page - threadsafe?

The background to this question is that I need to use some user session data in a (static) WebMethod. I have created a static property that references the data I need like so: private static UserWebSession UserWebSession { get { return (UserWebSession)HttpContext.Current.Session["UserWebSession"]; } } I can then ca...

Call .Net 3.5 WCF service from .Net 2.0 Standard ASMX Web Service Client

I create a service that is host on a server that have .Net 3.5 installed and I need to call this service from a client that only have .Net 2.0 installed Is there a way I can do this ? I'm using c# ...

How to use HttpWebRequest to call a Web Service Operation that takes in a byte[] parameter?

Hi guys I am trying to call a [webmethod] from C#. I can call simple webmethod that take in 'string' parameters. But I have a webmethod that takes in a 'byte[]' parameter. I am running into '500 internal server error' when I try to call it. Here is some example of what I am doing. Lets say my method is like this [WebMethod] publ...

Problems with ASP.net JSON Webservice response type

I am attempting to write an ASP.net web service that will be utilized by a jQuery AJAX call. I am absolutely at my wit's end trying to get this to work. I've seen a number of similar questions online but I haven't been able to find a solution that fits. When I attempt to make the ajax call (via jquery) I get a successful response from t...

Impersonation and CredentialCache.DefaultCredentials gives HTTP 401 Unauthorized

I have an ASMX web service (on my localhost - WinXP IIS 5.1) that I call from a webclient. My webservice must consume another ASMX web service (on a Win 2003 server IIS 6.0). When I provide credentials in my webservice code in a "hard-coded" manner: engineWSE.Credentials = new System.Net.NetworkCredential("myUser", "myPass", "myDomain...

JSON WebMethod not working in Sitefinity

I am trying to call via ajax a WebMethod hosted in a traditional ASP.Net WebForm code-behind page. Here is the code for the WebMethod: [WebMethod] public static object States() { StateProvince[] states = new StateProvince[] { }; ApplicationServiceClient proxy = null; try { proxy = new ApplicationServiceClient()...

.NET 2.0 Web Services WSDL Fault element being ignored?

I have a web service method where I would like to throw some custom exceptions e.g. SomeException, SomeOtherException etc which the web service would then turn into a SOAP fault which the client would be able to handle. In Java I can have wsdl:fault elements within the wsdl:operation element in the WSDL. It appears it .NET that this is n...

ASP.NET + Empty Response from WebServices / HttpHandlers

A few weeks ago, I posted a question saying that Update Panels had empty responses. I was unable to resolve it. However, today I noticed that webservices, and HttpHandlers also return nothing, IE this: public class Handler1 : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.ContentType ...