awright
awright

Reputation: 1234

WCF Web Services -- influencing which types are placed in which nested XSD's

I have two code-first WCF web services that expose a few of the same common types. WCF has chosen to put these types in different XSD's in each web service.

For example, in Web Service 1, my common types are in xsd3. In Web Service 2, they are in xsd4.

Is this entirely chosen by WCF, or is there a way to influence what it puts where? I've looked through service attributes, operation and data contract attributes and haven't found anything that seems to do this.

This causes problems on one of our Java-based web service clients, because the different XSD's cause the types to be duplicated.

Upvotes: 1

Views: 75

Answers (1)

SliverNinja - MSFT
SliverNinja - MSFT

Reputation: 31651

You cannot control the WSDL generation as far as how types are imported (i.e. XSD names) - this is entirely automatic and up to .NET internals. If this is an issue for you - you may consider merging Service 1 and Service 2 so that the type aren't duplicated OR you may need to isolate your service references using namespaces / separate projects libraries in Java to avoid type collisions.

Upvotes: 1

Related Questions