How to make an ASMX web service run in singleton mode? - asp.net

i am using web service asmx, whenever a new request comes, all objects will be null,
i want to keep some objects after each request, so how to do it?

There is no way to do this with ASMX web services. You would need to use WCF.
You should be using WCF in any case, as ASMX is a legacy technology.

Related

Simple way to call asmx web service from another asmx web service

I am using asmx webservice in my asp.net web application. For some case
I need to call the client's asmx webservice from my own webservice. what is the simple way to achieve this?
You can take a look at this post Calling webservice from another websservice
Basically, you will have to reference the second webservice from the first one and it would be similar to calling any other webservice.

How to secure my asmx web methods only to be called by my asp.net web application?

I have a web application which is having an asmx web service holding some web methods. Those are being called through jQuery ajax method to get data or do various operations.
I want it to be accessed by only my web application and no other ways to call the web methods and this should be a fully secured one.
Can any body suggest on what are the security threats might affect my web methods and how i can protect them from those threats ?
Any suggestions are appreciated.
If you are using session state then you can use this
[WebMethod (EnableSession = true)]

Calling WCF service from host

I am hosting a WCF service library in an ASP.net web application, which also needs to consume it. What is the best way to do so? Should I create a client proxy and invoke the service that way or is there a way of directly calling it? (the library is a project reference after all, and I guess doing so would be faster)
Since your WCF service library is a project reference for your web application, you could just instantiate the service directly without creating a client proxy. This approach would indeed be faster since you wouldn't be going through the serialization and deserialization that WCF does. However, you may wish to create a client proxy and access the service that way. This approach would be useful if there's any chance you may at some point host the service outside of your web application. If you were to end up moving the service, you would just need to update the endpoint address in your web application's web.config file.

Invoking a Web Service Without using Web Reference with SOAP authencation in asp.net

I need to bind web service reference at run time with SOAP or WSE authentication in ASP.NET.
i can handle this without authentication, but not getting the way to do this with SOAP or WSE authentication.
Any one can help me please...

Are asmx webservices compatible with REST?

I was just wondering are asmx files compatible with REST style requests?
I have some asmx files which need to service some third-party programs which are setup to send REST requests, not SOAP.
First of all, you should not be using ASMX for new service development: you should use WCF instead. It's much easier with WCF to have the same service handle both SOAP and REST-style endpoints.
The closest that an ASMX service will get to REST is that it can be configured to permit a GET or POST request, in which case it will return plain XML, with no SOAP envelope.
See Configuration Options.
But if you're trying to get "true REST" from ASMX, then you're out of luck.

Resources