When using the consume WCF / generated items wizard, items generated include the schemas, bindings and also an ODX containing Port Type definitions to consume the service.
And it is common / good practice to separate schemas from orchestrations into separate assemblies.
However, in the case of WCF generated artifacts the effort to separating these is considerable, as each Port Ty开发者_StackOverflow社区pe must then be edited to point to the reference assembly - this can be cumbersome with a Service with many operations (and a request / response for each). And this gets worse if the WCF service changes and needs to be regenerated.
So, if I may ask:
- What do you do consider best practice here? I am leaning toward keeping the Port types and dummy ODX's in the Schema assembly.
- Do you move the Generated Port Types out of the dummy ODX generated and then delete the Dummy ODX's?
Thanks!
I thing you're trying too hard.
What I would do is have the service reference of the consumed WCF service in an orchestration of its own (without any logic). Just a plain bare orchestration with only the port types defined there. This orchestration can then be in a separate assembly.
That way, you can reference this orchestration from other projects.
You should not try to separate the generated schemas from the port types. These are inextricably linked anyway because they are all, collectively, part of the "service contract".
精彩评论