I have a huge WSDL, but I need just a few methods from it.
Is it possible to generate WCF proxies only for these methods?
"Full implementation" adds 9 megabytes to my DLL.
You could manually build data contracts and an interface containing just the operations you are interested in and then use that interface with a ChannelFactory to create a basic client that will target only those operations, or...
... you could also strip the WSDL from all operations and elements you do not need and feed the result to svcutil.exe to create a simpler client. A safer approach would be to feed the large WSDL to svcutil.exe and strip what you do not need from the generated code (it's safer because the compilers will inform you immediately if you delete something you were not supposed to).
Either way, I think you will have to perform some manual interventions.
svcutil has an /excludeType
flag. It can be used during meta data export and type generation.
From the svcutil command line help:
/excludeType: - Fully-qualified or assembly-qualified type name to exclude from export or validation. This option can be used when exporting metadata for a service or a set of service contracts to exclude types from being exported. This option cannot be used with the /dataContractOnly option. (Short Form: /et)
The answer to How do I export metadata for a single contract with svcutil.exe? uses it to solve a simliar problem.
I hope type filtering works for you, because I don't know of an "out the box" way to do it by method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With