HighTechTalks DotNet Forums  

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

Dotnet Framework microsoft.public.dotnet.framework


Discuss Trying to separate "base classes" into a separate "baseclasses.cs" from "baseclass.xsd" in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Marc Scheuner
 
Posts: n/a

Default Trying to separate "base classes" into a separate "baseclasses.cs" from "baseclass.xsd" - 11-16-2007 , 01:07 AM






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

Reply With Quote
  #2  
Old   
JT
 
Posts: n/a

Default RE: Trying to separate "base classes" into a separate "baseclasses.cs" - 11-16-2007 , 07:33 AM






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.

"Marc Scheuner" wrote:

Quote:
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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.