Question

Okay, I have two OperationContracts and MessageContracts, like this:

[OperationContract]
OperationResult OperationOnSingleItem(Input input)

[OperationContract]
OperationResult OperationOnItemCollection(Inputs inputs)

[MessageContract]
public class Inputs
{
    [MessageBodyMember]
    Input[] InputCollection
}

[MessageContract]
public class Input
{
    ...............
    ...............
}

Now when I add this WCF service reference to a client, I see duplicate classes, both which correspond to the same Object Input.

i.e. in my client I can see ServiceReference.Input and another duplicate class called ServiceReference1.Input1.

Both have similar members, but i cant use the minterchangably since i get a type mismatch.

How do i stop the duplicate entries from being generated in the proxy.

Was it helpful?

Solution

Using svcutil from the command line, you can specify the location of the input class so that the duplicate class is not generated.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top