Click here to Skip to main content
15,942,449 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I have created WCF service and consumed it from ASP.Net web application by adding Service reference(“Add Service Reference”) and after creating object of this reference I am able to access methods of WCF service.

I was trying another implementation of consuming WCF service by creating proxy class, for achieving this I followed steps below :

  1. Created WCF Service.
  2. Created Client for consuming WCF service using ASP.Net form.
  3. Added reference of “System.ServiceModel” namespace.
  4. Created proxy class using “Svcutil.exe” with config file.
  5. Added generated proxy file say generatedProxy.vb in ASP.net project.
  6. Tried creating object of proxy class (generatedProxy) but here I am not able to get the proxy class itself.

Please suggest, If I missed out any step.
Posted
Updated 24-Apr-11 17:51pm
v3

Your steps look ok.
You need to add the namespace of your proxy class in the consumer class (the class that is trying to use the proxy).
 
Share this answer
 
Comments
Rahul Chitte 25-Apr-11 4:49am    
Hi Abhinav,
Adding namespace to consumer class has solved my problem.
Thanks a lot for your help.
Abhinav S 25-Apr-11 7:08am    
You are welcome.
If your application is not able to find the class, do this:

1. Type the client class name (if you are sure about it).
2. Click somewhere on the class name.
3. Press Ctrl + Shift + F10 and then enter. It will add the necessary namespace.

If this does not works, search for a class name ending with client in the proxy class and use that along with required namespace inclusion.
 
Share this answer
 
Comments
Abhinav S 25-Apr-11 0:48am    
In a way you have posted the same answer I posted, but you have provided the shortcut to enter the namespace - so 5 for that effort.
dan!sh 25-Apr-11 0:50am    
Just thought of boasting about me remembering VS shortcuts. :)
Abhinav S 25-Apr-11 1:04am    
:)
I just use Ctrl + . though.
dan!sh 25-Apr-11 1:13am    
Show off! :)
Abhinav S 25-Apr-11 7:08am    
:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900