Executing .NET web service methods from ASP.NET webform

I have a .NET developed web service application running on IIS in our office. Few web methods are supplied from this web service application allowing any applications to interact with the web service application. In order to consume or execute these web methods it is required to authenticate the user first.

Below code shows an example to read some data from web services application:

 

1                InteractApi inf = new InteractApi();
2                long userId = 1;  
3                long itemId = 2; 
4                
5                inf.PreAuthenticate = true;
6                inf.UseDefaultCredentials = true;
7                
8                try
9                {
10                ItemDetailsEx2[] details = api.GetItems(userId, new long[] { itemId });
11               }
12               catch (Exception ex)
13               {
14                Console.WriteLine(ex.Message);
15               }
There are methods to write some data as well as to read data from web services application. I would like to know 

1) How can i create a proxy or communication channel first to create an instance of InteractApi?
2) how can I read/write some data by passing parameters to web methods in web services application as shown in above code?

In simple  words I like to execute web methods from asp.net form to read/write data into web services application.

Your help and insight is appreciated.
 


-- "Mark As Answer" if my reply helped you --
0
sukumarraju
10/15/2008 2:28:10 PM
📁 asp.net.getting-started
📃 91979 articles.
⭐ 0 followers.

💬 1 Replies
👁️‍🗨️ 131 Views

 http://www.xefteri.com/articles/show.cfm?id=15

I think this article have answer for your question

0
anonymouswrites
10/15/2008 3:06:44 PM
Reply: