0

I have a service that contains two endpoints. I have a client that wants to use just the methods in one of the endpoints. If I use Add Service Reference both endpoints and all their methods are imported.

I am working on defining an svcutil command and it appears the /et option is what I need to exclude the first endpoint and it's methods, but I can't find a clear example of a fully qualified type name. Plus I'm not sure the /et switch is the switch I need to use. The connection is being done through a wsdl for a C# implementation.

I've tried /et:namespace.class.interface name and every variation of this that I can think of, but the generated .cs file still contains all the methods for the endpoint that I don't need.

For example

namespace a.b.c { public interface InterfaceToExclude { [OperationContract] bool MethodToExclude()

my service definition is

public class MyService: InterfaceToExclude, InterfaceToInclude {

so would the /et switch be

1) /et:a.b.c.InterfaceToExclude or

2) /et:a.b.c.InterfaceToExclude.MethodToExclude

sadly neither of these two options actually caused the generated .cs code to exclude the first endpoints interfaces, methods or data definitions.

my current svcutil command is

svcutil /target:code http://machine.domain/path/MyService.svc /language:CS /et:a.b.c.InterfaceToExclude

Can you exclude the generation of the methods and support for one of the endpoints using the svcutil command? If so what switches do this? Is it includes or excludes?

Thanks!

jgraff
  • 1
  • 1
  • There's a brief example in the comments here: https://stackoverflow.com/a/8786178/1531971 –  Sep 26 '17 at 18:31
  • Thanks jdv! So for my part if I look at the interface that I want to exclude the cs files contains something like inline `namespace a.b.c { public interface IMyInterface { [OperationContract] bool MethodToExclude()` so would the /et switch say /et:a.b.c.IMyInterface or /et:a.b.c.IMyInterface.MethodToExclude – jgraff Sep 26 '17 at 21:07
  • Since comments can be removed easily, it's best if details like this are in the body of the question. This way it is clear what question you are asking, and makes it more likely that someone will be able to help you. –  Sep 27 '17 at 02:00
  • That being said, I think the implementation of the interface would be the type, since interfaces are technically not types AFAIK. –  Sep 27 '17 at 02:14
  • Neither option that I've added to my /et switch removed the unwanted service endpoint references. Is there another variation? – jgraff Oct 06 '17 at 20:51

0 Answers0