Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

SVCUtil Reference and Duplicate Classes

 
 
Thread Tools Display Modes
Old 01-19-2007   #1 (permalink)
joe.osowski@gmail.com
Guest


 

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?

Old 01-19-2007   #2 (permalink)
Joerg Jooss
Guest


 

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


Old 01-22-2007   #3 (permalink)
joe.osowski@gmail.com
Guest


 

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


Old 01-23-2007   #4 (permalink)
Joerg Jooss
Guest


 

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


 

Thread Tools
Display Modes









Vistax64.com 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 2005-2008

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 47 48 49 50