Questions tagged [asmx]

The web service technology from .NET 1.0, now considered a "legacy technology".

The web service technology from .NET 1.0, currently considered a "legacy technology". For new development of web services or web service clients the use of Windows Communication Framework (WCF), ASP.Net Web API or other modern frameworks is recommended.

The ASMX Web Service technology was introduced with .NET 1.0 as "ASP.NET Web Services", and has also been called "XML Web Services". The term "ASMX" refers to the file type of the web service endpoints, such as WebService1.asmx. Note what Microsoft says about their ASMX Forum:

This forum has been retired. It is locked, but is still available for review in the Archived Forums folder. Any future posts on this topic should be put in the Windows Communication Foundation, Serialization, and Networking forum.

ASMX Web Services only support SOAP or JSON over HTTP or HTTPS, and have limited extensibility.

Important ASMX Questions

Other Obsolete Technologies

Web Service Extensions, or WSE were a set of stopgap releases that added to the ASMX technology to permit developers to work with the emerging WS-* standards as they were being developed by the industry. That means you will often find WSE mentioned in conjunction with security. This does not mean that WSE is the solution to security in web services, it means that WSE was that solution until WCF was released. WCF supersedes WSE, which is now obsolete. In fact, WSE is not supported on Windows 2008 or later releases, and is not supported by Visual Studio 2008.

Even more obsolete is the SOAP Toolkit. This was a way to create clients for web services, and worked for old VB or ASP applications. Do not use it.

2830 questions
14
votes
2 answers

Invalid JSON primitive: id

I cannot get the following function to work properly. It seems to be serializing it wrong. This is about the 5th iteration of different data variants. I was originally just doing data: {'id': id} like I do at work with WCF, but with the ASMX it…
user736893
14
votes
4 answers

How to get JSON response from a 3.5 asmx web service

I have the following method: using System.Web.Services; using System.Web.Script.Services; using System.Web.Script.Serialization; using Newtonsoft.Json; using System.Collections; [WebService(Namespace =…
Mansinh
  • 1,365
  • 4
  • 19
  • 47
14
votes
1 answer

HTTP 404 error while invoking a local webservice in .NET MVC4

I am trying to learn webservices in .NET mvc4. I tried creating a new Internet application and adding a Web service (asmx) to the project. By default, the VS adds a "HelloWorld" Webservice. When I try to run it in the browser, I do get the list of…
saurabh
  • 1,730
  • 2
  • 15
  • 13
14
votes
1 answer

How to return multiple values from a webservice?

I am very new to the world of web services so please bear with me. I am creating a very simple web service in Visual Studio 2010 using .asmx files. Here is the code I am using: namespace MyWebService { [WebService(Namespace =…
Baxter
  • 5,633
  • 24
  • 69
  • 105
14
votes
3 answers

Should it be a WebAPI or asmx

Should I leverage an ASMX service or the ASP.NET Web API for my two simple API's? I want to create two simple APIs in my ASP.NET MVC project. One takes in 3 parameters (currentUserID, DataType, ActionName). It returns them and an XML string of the…
Matt
  • 3,305
  • 11
  • 54
  • 98
13
votes
2 answers

Why Can WebMethod Access Session State Without EnableSessionState?

I have a method on a page marked as a [WebMethod] that uses some session state as part of its operation. After I wrote this code, I suddenly had a flash of memory that you need to use EnableSessionState when you use session state in a [WebMethod]…
user12861
  • 2,358
  • 4
  • 23
  • 41
13
votes
1 answer

Adding Custom Http Headers to Web Service Proxy

I have an old application that uses the classic Web Service Proxy to interact with a Java Web Service. A while back the Web Service hoster decided to require a custom HTTP header to be sent with each request in order to access the service -…
Rick Strahl
  • 17,302
  • 14
  • 89
  • 134
12
votes
3 answers

The name 'HttpContext' does not exist in the current context

I am trying to convert some vb.net to C#, but I keep getting errors. At the moment, I am getting the error in the title. The problem line is: string[] strUserInitials =…
oshirowanen
  • 15,297
  • 82
  • 198
  • 350
12
votes
4 answers

Cache object with ObjectCache in .Net with expiry time

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…
kawafan
  • 231
  • 1
  • 7
  • 16
12
votes
6 answers

What to choose? ASMX web service or WCF in .net 3.5?

The current project i am working on is extensively using web services and is made in .net 3.5. Now as we are going for implementation of second phase we are confused if we should either use WCF or web service as done previously ? Further is there…
HotTester
  • 5,620
  • 15
  • 63
  • 97
12
votes
4 answers

WebService Problem Asp.Net

I just created my first Web Service. I use: IIS 7.5 VS 2008 .Net 3.5 After install my IIS and browse to my asmx file in IE I get the follow Error: HTTP Error 500.21 - Internal Server Error Handler "ScriptHandlerFactory" has a bad module…
PassionateDeveloper
  • 14,558
  • 34
  • 107
  • 176
12
votes
9 answers

ASP.NET JSON web service always return the JSON response wrapped in XML

I saw a similar question but it did not resolve my issue. I have a JSON web service in an ASMX file; The code for the web method [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string…
JohnnyCantCode
  • 153
  • 1
  • 2
  • 6
12
votes
7 answers

Should web services throw exceptions OR result objects

I'm not sure I'm completely happy that throwing exceptions in web services is a good idea. I wouldnt mind as much if it wasn't for the stack trace. This is not something I wan't. I have researched around several implementations and there really…
Ryan Tomlinson
  • 874
  • 2
  • 9
  • 21
11
votes
1 answer

.asmx Web Service Documentation

I'd like my summary, param info, returns info, etc (listed below) to show up on the standard help page that .net generates for .asmx web services. /// /// Brief description /// /// Fake Param One…
James Hill
  • 60,353
  • 20
  • 145
  • 161
11
votes
2 answers

Using JQuery to call a WebMethod

I am having trouble getting inside my Search WebMethod from my JQuery call. Maybe someone could help to point me in the right direction. I also packed up everything into a zip file incase someone wants to check it out for a closer…
Ryan