tags:

views:

22

answers:

2

how to call a webmethod in one application from another application,both developed in c#?

A: 

You can't do this, of course. It would be a huge security hole.

As suggested by your tag, it would be necessary for the developer of an application to explicitly expose to the world the methods he wants to be called from other applications. This could be done through WCF, or possibly through COM.

Alternatively, the code to be called caould be placed into a class library, and referenced by both projects.

John Saunders
A: 

Expose the method through SOAP or REST or COM or (going old-school) CORBA or ...

Be prepared that doing this is a massive increase in the complexity of the applications. You start to have to worry properly about security, and about how all the pieces interact, and many other issues. There's a lot of depth here, far too much for a simple answer.

Donal Fellows