Can a web link be exposed from another class?

the question is simple.

we usually use a web link to use web services literally (visual studio). But my problem is another way. I need to call a specific web service from a C # class to make the web service available to others.

+3
source share
2 answers

First of all, if you have a choice, you should use WCF both on the server and on the client. If you cannot use it on the server for any reason, then at least use it on the client using "Add Service Link" instead of "Add Web Link". Add Web Link is part of the old ASMX technology that should not be used for new development.

Secondly, of course, you can create a separate class library and use the "Add Service Reference" in this library. Then you can write a class that has public methods that call the service. Users of this class library will call your public methods and will not directly access the service.

+3
source

# -, - VS ( , ). Reference.cs, - -.

WS. , , / .. , WS .

, , @JohnSaunders WCF

+1

All Articles