asmx

.NET: Output caching for WebMethod?

Can I have the return value of a WebMethod outputcached? E.g. if the WebMethod has been called in the last X seconds or minutes, don't actually run the method again--just use the same result as it last served. Or should I roll my own caching internally in the class/WebMethod? ...

ASMX Web service not serializing abstract base class

I have an abstract class. Let's call it Lifeform. It looks something like: public abstract class Lifeform { public virtual int Legs { get; set; } public virtual int Arms { get; set; } public virtual bool Alive { get; set; } } (The virtual attribute is due to the fact that I'm using nHibernate, which whines if they're not v...

Why are Static Methods not Usable as Web Service Operations in ASMX Web Services ?

I just wanna learn why I can't static web methods in web services ? Why is it restricted ? Can some body give me concise explanation of this. ...

Object Sent to Web Service Contains "null" Property

It is possible to send an instance of a class to a webmethod on a webserver isn't it. (The class is actually created on the webserver). I ask because I have a populated class instance which I'm trying to send back to the webserver, however when the instance arrives at the webmethod, it has been emptied (a fresh instance has been created...

MicrosoftAjax.js, SOAP Web Services, and static HTML

What is the proper way to call a ASMX Web Service with MicrosoftAjax.js if your just including the JavaScript in static HTML? What I have so far: <html> <head> <title>Testing</title> <script type="text/javascript" src="scripts/MicrosoftAjax.js"></script> <script type="text/javascript"> function testCallSoap() { ...

How to: debug an ASP.NET Web-Service when called from a win-application

I have a windows forms applications that accesses a web service. I want to debug the web service so that when I call its methods from the win-app it should stop on the breakpoints within the methods. ...

Namespace Prefixes in Wsdl (.net)

Namespace prefixes in my wsdl are automatically generated: s1:, s2:, etc, how can i put a specific prefix for my namespaces? Can't find it anywhere... Do i have to override the xml serialization and add them by hand (how do i do that in .net webservices?) (i mean in .net2.0 asmx, the guys who are going to use this webservice say they...

Return Value From Asynchronous Web Service Call

I'm using ASMX web services in VB.Net in VS 2005. I am calling a function method on the web service that returns a true or false value. This works fine if I call the the web method synchronously, but if I want to call the method asynchronously, the function returns to a sub and there is no return value; therefore, I can't tell whether ...

Problem with sending a Webservice a List Of Objects .Net

I have a web service that looks like this [WebMethod] public int Import(System.Collections.Generic.List<Record> importRecords) { int count = 0; if (importRecords != null && importRecords.Count > 1) { DataLayer datalayer = new DataLayer(); foreach (Record brec in importRecords) ...

Is it possible to restrict certain ASMX web service methods to GET or POST only?

Unfortunately, I'm doing some work on a (legacy) project that is build with ASP.NET Web Forms. I can't migrate it to ASP.NET MVC (so please don't suggest that as an answer). I wish to create an API to expose some of our data. So, I went a head and made a web service. Pretty simple stuff. BUT, for the first few methods, I wish to expose ...

Web service throwing an exception?

Ii have a web method that looks like this: [WebMethod] public int ImportData(System.Collections.Generic.List<Record> importRecords) { int count = 0; if (importRecords != null && importRecords.Count > 0) { DataLayer datalayer = new DataLayer(); foreach (Record rec in importRecords) { datala...

ASMX Web Services + Active Directory question

I have a client that calls a web service that then hits AD to get information. Recently i started to have the following behavior. after a long wait or a IISReset, the Client calls the web service, the web service shows the call, starts to DirectoryEntry.RefreshCache();. (Which is inside a try catch that should log any exceptions) Then...

Does redirecting a web service URL have any effect on the web service?

Let's say a client gave me this URL to access a webservice to GetQuotes: http://www.somecompany.com/services/myservice.asmx If I tried to access the web service and I get redirected to: http://new.location.somecompany.com/theservice.asmx Will this affect the ASP.NET client calling this web service? Where both service URLs have the e...

Catch Custom Exception from ASMX Web Service

I have a web service in which I have created a custom exception. Let's say the name of this exception is InvalidContractException. What I would like to do is if a specific step occurs, I want to throw this exception. However, I can't figure out how the client would catch the InvalidContractException in order to handle it properly. ...

ASMX Web Service Urgent Help

I am just working on .NET for the past six month.I am using VS 2005.I have been assigned a task to test a Web service.I have created a Web service project in VS 2005 IDE and a simple method that returns an ArrayList of employee type.I have the employee table in SQL Server 2005 Standard Edition. I need to perform the following tasks :...

How to access ASMX Web Service Client Proxy Type?

I am using VS 2005 (C# ). My Webservice returns a type as follow : [WebMethod] public Employee getEmployee( ) { Employee emp=new Employee(); emp.EmpID=1000; emp.EmpName="Wallace"; return emp; } from Client side i have created a Proxy. localhost.Service1 svc = new WindowsApplication1.localhost.Service1(); How...

Restricting access to ASMX web service

There id this existing ASP.NET (2.0) web service that's called from PHP. Runs fine. Now the need arises to restrict access. Constraint: I currently don't have access to IIS/Windows account management to implement something robust,. I'm thinking about adding a SOAP header to the PHP call, containing a secret key, and then checking the c...

Serializability of enum-like class

I need to access an enum through a webservice. As a webservice allocates 0 based integers to an enumeration (ignoring preset values in enum definition), I built the following: public class StatusType { public StatusVal Pending { get { return new StatusVal( 1, "Pending"); } } public StatusVal Authorised { get { return new Statu...

Examples of practical usage of JSON to and from an ASMX web service via jQuery

Can anyone recommend an article on sending and receiving JSON to an asp.net web service (any flavor) that uses more practical examples than "hello world". Ideally, something that covers topics like: Receive a single complex object from a web service (to display in a form) Receive a collection of complex objects from a web service (to...

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 - otherwise the requests are thrown out outright (looks like this is some sort of router requirement...