how to generate client proxy class of a wcf service that will work in the .net 2.0

佐手、 提交于 2019-12-13 12:16:20

问题


I have to use a wcf service in the ssis script component which is developing in BIDS 2005. For this i have generated the proxy class of that service using svcutil.exe. After attaching the proxy class in the script component it has error of some class such as System.Runtime.Serialization.DataContractAttribute is not defined. Any suggestion how can i resolve this issue.. Or can wsdl is used to genrate proxy class of wcf service. so that it can be used in the .net 2.0.

Thanks


回答1:


Finally after much struggling over it, i have resolved the issue. Now i have successfully created the proxy class of the wcf service and also it is now working in .net 2.0.

I have gone through the following steps:--

Note: this will work only if the wcf sercice(.svc) will be using BasicHttpBinding which is similar to webservice (.asmx)

Step1:- run the following command on the visual studio command prompt.

svcutil.exe /target:metadata http://Your service address

It will create wsdl file with some other files in the path C:\Program Files\Microsoft Visual Studio 10.0\VC

Step2:- Now run the wsdl command

wsdl.exe tempuri.org.wsdl tempuri.org.xsd schemas.microsoft.com.2003.10.Serialization.xsd

This will generate a v2.0 client proxy class that can be used to access the service.

Note: if some error occurs in the wsdl command, Use all the files name instead of using these three separated by space..



来源:https://stackoverflow.com/questions/11738468/how-to-generate-client-proxy-class-of-a-wcf-service-that-will-work-in-the-net-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!