Wednesday, March 21, 2012

Generate Proxy class of wcf and webservice....

Open the visual studio command prompt with administrator rights and Select the Drive where you want to store..and then type
For example your wcf service is hosted on http://localhost/TestService/Achievementmaster.svc Then you can write like this

D:\>svcutil.exe http://localhost/TestService/Achievementmaster.svc?wsdl/out:proxy1.cs

Then You can see the generated proxy class in D drive.......


Now if you want to generate proxy class for webservice then


D:\>wsdl /language:c# /out:d:\myProxyClass.cs http://localhost/WebService/Service1.asmx?WSDL


where you can also write vb in language if you want to generate in vb code



Use Of Proxy Class..............
Introduction
                 we can generate the proxy class of WCF service or web service.As I discussed How to generate proxy class in above discussion and How to create a webservice in http://aspdotnetbank-kartik.blogspot.in/2012/05/how-to-create-webservice-and-how-can-we.html

                 For Webservice and WCF service we need to add the reference in our project.but by using the Proxy class we dont need to add the reference in our Project.By just discussed as above generate the Proxy class of it.Then add that class in your project and then after we can use it same as we use in by adding the reference of it.

                Hope this will help you in future.................
              

0 comments:

Post a Comment