Use same datacontract for different services

Topics: General Discussion Forum, July and December Releases Forum, Service Factory Modeling Edition Forum
Apr 1, 2008 at 1:47 PM
When I use same datacontract for different services,the client create proxy for each service,but each proxy have different namespace for same datacontract,for example:
BYA.Mfg.SCM.Svc.WCF.Client.MaterialMgmtProxy.AircraftPart a;
BYA.Mfg.SCM.Svc.WCF.Client.MyProxy.AircraftPart b;
you can not set a=b;
How to solve this problem?
Apr 1, 2008 at 4:03 PM
The way to solve that is to simple generate the proxy without DCs and refenrece them from your DC library (where you defined your DC types). You can generate proxies without DCs by specifying that in VS wizard dialog or by running the command line tool svcutil.exe against your running service in order to get the WSDL from it.
Apr 2, 2008 at 5:26 AM
Thanks charlyfriend. But I cann't find where to specify in VS wizard dialog or find the switch for svcutil.exe,so that client create proxy without DC types.Would anybody detail that?
Apr 2, 2008 at 4:08 PM
In VS2008 you have that switch in the "Advanced..." button in the bottom left corner of the "Service Reference Settings" dialog. Otherwise in VS2005 you may use the commend line "svcutil.exe" tool that comes with the SDK and have a switch to share your types from the assembly file you specify.