Use web service in asp.net application from class library

My team and I use the asp.net web form application and use several class libraries. In one of these libraries we are trying to use a web service. A web link has been added to the web application project and corresponding links have been added. The application is compiling. When you try to use the specified web service in the class library, the credentials do not seem to work, and the call fails. However, if we take a web service call from a class library and consume it in a web application, it works.

Any ideas why this is not working in the class library.

0
source share
6 answers

Maybe you called it wrong! Here is an example:

var serviceName = new ServiceName
    {
        Credentials = new NetworkCredential("Username", "Password", "Domain"),
        Url = "Here you put the correct url of the web service if you published somewhere else"
    };
serviceName.CallWebMethod();

, , - , .

0

-.

URL- .

, , , , , -.

" , , , "... ?

, WCF . - SOAP ASMX, .

+2

-, :

  • " "
  • ""
  • " -"
+1

... .. , , ... , . ... ???

-, , .

+1

- -? , , , . , . . , .

+1

-, :

"" " -"

@AMgdy, Reference.cs. -.

+1

All Articles