Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - SVCUtil Reference and Duplicate Classes

 
 
Old 01-19-2007   #1 (permalink)
joe.osowski@gmail.com


 
 

SVCUtil Reference and Duplicate Classes

I am having issue with svcutil, references and the classes it
generates. I have two service contracts that implement some of the
same classes in their results that I want the proxy code to share. The
source files it outputs no matter what I try keeps putting the same
class in all of the files.

For what it is worth, the class that is being placed in every proxy is
based off of the Generic List. All of the other classes replicated
across the contracts are filtered out. It is just this one class, in
the same namespace as all of the other classes filtered.

Here is the command:
Svcutil /r: com.digitalbp.common.dll
http://localhost:8083/UserService?wsdl

This runs and output a UserService.cs class with this code inline
(cut/paste):

namespace com.digitalbp.common
{
using System.Runtime.Serialization;



[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization",
"3.0.0.0")]

[System.Runtime.Serialization.CollectionDataContractAttribute(ItemName="Error")]
public class ErrorCollection :
System.Collections.Generic.List<com.digitalbp.common.Error>
{
}
}

There are a number of other classes defined in com.digitalbp.common
that are not included. Namely as you see above the Error class.

Any ideas?


My System SpecsSystem Spec
Old 01-19-2007   #2 (permalink)
Joerg Jooss


 
 

Re: SVCUtil Reference and Duplicate Classes

Thus wrote joe.osowski@gmail.com,

> I am having issue with svcutil, references and the classes it
> generates. I have two service contracts that implement some of the
> same classes in their results that I want the proxy code to share.
> The source files it outputs no matter what I try keeps putting the
> same class in all of the files.
>
> For what it is worth, the class that is being placed in every proxy is
> based off of the Generic List. All of the other classes replicated
> across the contracts are filtered out. It is just this one class, in
> the same namespace as all of the other classes filtered.

[...]

Do you need to use generated proxies at all?

For type sharing scenarios, I'd rather go with ChannelFactory<T>.

Cheers,
--
Joerg Jooss
news-reply@joergjooss.de


My System SpecsSystem Spec
Old 01-22-2007   #3 (permalink)
joe.osowski@gmail.com


 
 

Re: SVCUtil Reference and Duplicate Classes

Thanks, but I don't believe that is relevant to the bug I am seeing.
Be it a proxy or a ChannelFactory, I can't compile as the typed generic
class is duplicated in multiple classes.

Joerg Jooss wrote:
> Thus wrote joe.osowski@gmail.com,
>
> > I am having issue with svcutil, references and the classes it
> > generates. I have two service contracts that implement some of the
> > same classes in their results that I want the proxy code to share.
> > The source files it outputs no matter what I try keeps putting the
> > same class in all of the files.
> >
> > For what it is worth, the class that is being placed in every proxy is
> > based off of the Generic List. All of the other classes replicated
> > across the contracts are filtered out. It is just this one class, in
> > the same namespace as all of the other classes filtered.

> [...]
>
> Do you need to use generated proxies at all?
>
> For type sharing scenarios, I'd rather go with ChannelFactory<T>.
>
> Cheers,
> --
> Joerg Jooss
> news-reply@joergjooss.de


My System SpecsSystem Spec
Old 01-23-2007   #4 (permalink)
Joerg Jooss


 
 

Re: SVCUtil Reference and Duplicate Classes

Thus wrote joe.osowski@gmail.com,

> Thanks, but I don't believe that is relevant to the bug I am seeing.
> Be it a proxy or a ChannelFactory, I can't compile as the typed
> generic
> class is duplicated in multiple classes.


You missed the type sharing part of my answer. There will be no generated
code if you use ChannelFactory<T> *and* a shared contract assembly, if that's
acceptable in your case.

Cheers,
--
Joerg Jooss
news-reply@joergjooss.de


My System SpecsSystem Spec
 

Thread Tools



Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46