.NET tool to generate wrapper for proxy classes

2020-08-04 09:23发布

Using SvcUtil I generated proxy for a SOAP WebService. This webservice has many complex types and can change every year. Is there a tool I can use to generate wrapper for all classes. Using composition in wrapper class I will call proxy class.

标签: c# .net wcf oop soap
1条回答
看我几分像从前
2楼-- · 2020-08-04 09:51

Svcutil.exe generate POCO types at the client sides according to the XSD parts of WSDL. There shouldn't be T4Template involved which is too complex and overkill and inappropriate. Svcutil.exe could have created all the proxy classes you need.

If the complex types may be changing every years, you may consider versioning.

Once an interface is published, you should not changed it. This applies to both operation contracts and data contracts.

You may refer to this article WCF for the Real World, and google WCF versioning.

So basically you explicitly declare XML target namespace in the contracts, and map CLR namespaces with XML namespaces. When you need to change the complex types, you have to provide another version of WCF service. During the transition period before all the clients could upgrade to the latest version, you keep both versions running.

查看更多
登录 后发表回答