WCF return Types over 2 services
I have a WCF Service Application. I have 2 different contracts(services). I did this because by having them o开发者_JAVA技巧ne big service, there will be 80 - 90 Operation contracts.
So I divided them into 2 services. Both these services share some Business objects (data contracts from DAAB layer). Both the services are used by one app.
I have a ambiguous types on the client side, because even though they are one complex datatype on the service side, they are considered 2 different data types on the client side.
Is there way where I can say both are of the same kind on the client side?
I ran into a similar problem on a project... We just called svcutil.exe directly to generate our client proxies. The trick is to pass in both services at the same time so that it can re-use the types.
EDIT: This article appears to solve the problem you're having:
http://blog.jasonconnery.ie/net-reusing-types-across-multiple-webservices
svcutil http://localhost/Service1.asmx http://localhost/Service2.asmx
/out:api.cs /namespace:*,SomeNamespace.API
精彩评论