简体   繁体   English

Web服务客户端从服务器引用DLL

[英]Web service client referencing DLL from Server

I have a web service which outputs a JSON serialised string object. 我有一个输出JSON序列化字符串对象的Web服务。 This is just a simple object with simple properties. 这只是具有简单属性的简单对象。 I would really like the consumers of the service to be able to deserialise the object so as to have the complete object to use easily in their projects. 我真的希望服务的使用者能够反序列化对象,以使完整的对象可以在其项目中轻松使用。

My question is, is it possible for my clients to reference a DLL on my site (which I might update occasionally to provide further properties) from their projects so that they will always have the latest version of the DLL? 我的问题是,我的客户是否可以从他们的项目中引用我站点上的DLL(我可能会不定期更新以提供更多属性),以便他们始终拥有最新版本的DLL? Or is my only option to distribute a lightweight DLL for all client web service users with just the objects they need? 还是我唯一的选择是为所有客户端Web服务用户仅分发他们需要的对象来分发轻量级DLL? Trouble is, with that method, if I update the object on the web service then all clients consuming the service will fall over until they update the DLL from me. 麻烦的是,使用该方法,如果我更新Web服务上的对象,则使用该服务的所有客户端将失败,直到他们从我那里更新DLL。

Any other options or solutions to this or have I missed something completely obvious? 还有其他选择或解决方案,还是我错过了一些显而易见的事情?

One of the more important ideas behind SOA is decoupling. SOA背后更重要的想法之一就是去耦。 That's the opposite of what you're trying to do - you'll be tightly coupling your clients to your service. 这与您要尝试的相反-您将把客户与服务紧密地联系在一起。 Try to avoid doing that. 尝试避免这样做。

In any case, if you were using SOAP with WCF, then it would be trivial to do this. 无论如何,如果您将SOAP与WCF一起使用,那么这样做将是微不足道的。 I don't know that you can use "Reuse types" with a JSON-based service. 我不知道您可以将“重用类型”与基于JSON的服务一起使用。

And you certainly cannot do this with an ASMX service. 而且您当然不能通过 ASMX服务做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM