我可以通过JavaScript .NET库进行交互? [英] Can I interact with .NET libraries through Javascript?

查看:183
本文介绍了我可以通过JavaScript .NET库进行交互?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经建立了一组用于与外部资源进行交互的.NET库(C#)的。外面的资源提供Java和.NET绑定,因此有必要建立我们的图书馆在这些语言之一,我们正式在Windows商店。

We've built a set of .NET libraries (in C#) which are used to interact with an outside resource. The outside resource provide bindings in Java and .NET, so it was necessary to build our libraries in one of those languages and we're officially a Windows shop.

我们还使用PHP / JavaScript来了我们很多的前端Web应用程序。是否有可能为这些PHP / JavaScript的Web应用程序与我们的.NET库进行交互?我们有IIS和Apache Web服务器,如果有差别。沟通需要走在两个方向。

We also use PHP/Javascript for a lot of our front-end web applications. Is it possible for these PHP/Javascript web applications to interact with our .NET libraries? We have both IIS and Apache web servers if that makes a difference. Communication would need to go in both directions.

推荐答案

最明显的方法是暴露你的.NET库的作为Web服务的Web服务器上(无论IIS或Apache /单声道)。这使得这两个JS和PHP消耗相同的服务端点(通过AJAX JS,PHP VS Web服务调用)。

The most obvious approach is exposing your .NET libraries as web services on a web server (either IIS or Apache/Mono). This allows both JS and PHP to consume the same service endpoints (JS via AJAX, PHP vs web service calls).

如果极端的表现是一个问题 - 例如,你的PHP应用程序需要进行重调用到.NET库,就好像他们是本地的,那么Web服务可能不是最好的方法。对于这一点,你可能要考虑让 COM调用包装您.NET库和从PHP 消费它们。

If extreme performance is a concern - for example, your PHP apps need to make heavy calls into the .NET libraries as if they are native, then web services are probably not the best approach. For that, you might want to look into making COM Callable Wrappers for your .NET libraries and consuming them from PHP.

这篇关于我可以通过JavaScript .NET库进行交互?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆