Trying to separate "base classes" into a separate "baseclasses.cs" from "baseclass.xsd"

M

Marc Scheuner

Folks,

I have three WCF services that I need to implement - they're all
nicely defined using WSDL and XSD. Common helper and utility classes
that all services use have been extracted into a "baseclass.xsd" file,
which gets imported into each serviceA.xsd, serviceB.xsd etc. - these
classes are in their own XML namespace.

What I'd like to do is generate C# code from this, so that I have a
"baseclasses.cs", "serviceA.cs", "serviceB.cs" and "serviceC.cs" where
the serviceX.cs would import / include / use the "baseclasses.cs" -
just keep everything nicely separated and use common code.

However, when using svcutil.exe to convert the WSDL/XSD to code

svcutil baseclass.xsd serviceA.xsd serviceA.wsdl /outerviceA.cs

it basically converts everything fine, however, the helper classes
from "baseclass.xsd" are merged into "serviceA.cs", "serviceB.cs", and
into "serviceC.cs", too - so now I have each of these helper classes
three times........

What am I missing? Can I achieve what I'm trying to do? Or is this not
the "xsd-way of doing things?" .....

Thanks!
Marc
 
G

Guest

I'm not sure if you can do this directly using svcutil but there's nothing
stopping you hacking the code afterwards. I find that svcutil creates a lot
of chaff code and the proxy can be greatly simplified.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top