.Net Consuming Web Service: Identical types in two different services

.net, web-services

Solution

What ended up working for me was to provide the svcutil.exe all WSDL addresses that I needed to generate code from. SVCUTIL will look at all the types from each service and determine automatically which ones are common and should be re-used.

The type that you want to be shared should also have a shared namespace, and that namespace should be called out on each of the webservices that want to share that type.

Problem

I have to consume 2 different web services. Both contain a definition for a 'user' object. When I reference the services using "Add service reference" I give each service a unique namespace: ``` com.xyz.appname.ui.usbo.UserManagement com.xyz.appname.ui.usbo.AgencyManagement ``` The problem I have is that each one of the proxies that are generated contain a new user class. One is located at com.xyz.appname.ui.usbo.UserManagement.user and the other at com.xyz.appname.ui.usbo.AgencyManagement.user. However, the user objects are identical and I would like to treat them as such. Is there a way that I can somehow reference the user object as one object instead of treating them as two different? I am using .Net 3.5 to consume the service. The service being consumed is written in Java. Thanks!! Edit: This forum thread got very close to an answer, but the accepted answer ended up being to share types from client and server - which I cannot do because we're crossing platforms (Java to .Net). The real question is, is there a /sharetypes type of parameter for svcutil in WCF?

Original source