This question already has an answer here:
这个问题在这里已有答案:
- Call C# dll from a Java Application 2 answers
- 从Java Application 2答案中调用C#dll
Does anyone know if it's possible to invoke C# methods/classes (from a dll) in a Google App Engine Java app (server side)? If it's possible, do you have any idea how it could be achieved?
有谁知道是否可以在Google App Engine Java应用程序(服务器端)中调用C#方法/类(来自dll)?如果有可能,您是否知道如何实现?
EDIT - Any other variants beside using web services?
编辑 - 除了使用Web服务之外的任何其他变体?
EDIT 2 - This question is specific to the Google App Engine environment.
编辑2 - 此问题特定于Google App Engine环境。
2 个解决方案
#1
2
No.
没有。
Each python, java, go and now PHP runtime has a list of directly supported libraries that might have binary file dependancies. e.g. The python runtime has support for Numpy, PIL, PyCrypto and a few others https://developers.google.com/appengine/docs/python/tools/libraries27
每个python,java,go和now PHP运行时都有一个直接支持的库列表,这些库可能具有二进制文件依赖性。例如python运行时支持Numpy,PIL,PyCrypto和其他几个https://developers.google.com/appengine/docs/python/tools/libraries27
Java has a whitelist of aceptable base/core classes, upon which everything else is built. You can include your own jars, but only if the call whitelisted classes when trying to interact with the machine, network etc... - ie there are no GUI classes (like swing).
Java有一个aceptable基础/核心类的白名单,在其上构建其他所有内容。你可以包括你自己的罐子,但只有当试图与机器,网络等交互时,呼叫列入白名单... - 即没有GUI类(如swing)。
You can't just upload and call some arbitrary binary object, in your case a windows DLL, or some linux shared library. One of appengines strengths in fact is the secure sandbox.
你不能只是上传和调用一些任意的二进制对象,在你的情况下是一个Windows DLL,或者一些linux共享库。事实上,其中一个优势是安全的沙箱。
Some basic reading of the introduction to appengine docs for any of the runtimes will give you a feel for what you can and can't do. The environment is changing over time, until recently you couldn't make outbound socket calls. I seriously doubt however you will be able to ever just install/run some abritrary binary object that has been built for some other platform.)
对任何运行时的appengine文档介绍的一些基本阅读将让您感觉到您能做什么和不能做什么。环境随着时间的推移而变化,直到最近您无法进行出站套接字调用。我严重怀疑你是否能够安装/运行一些为其他平台构建的abritrary二进制对象。)
#2
2
While not a GAE specialist, I do believe you may be able to access C# methods if they are exposed as a WebService.
虽然不是GAE专家,但我相信如果它们作为WebService公开,您可以访问C#方法。
Here´s a post about how to do it via Python: http://www.bloing.net/2011/01/soap-webservice-gae-python-howto/
这是一篇关于如何通过Python实现的文章:http://www.bloing.net/2011/01/soap-webservice-gae-python-howto/
And here, how to create a c# WebService: http://www.codeproject.com/Articles/863/Your-first-C-Web-Service
在这里,如何创建一个c#WebService:http://www.codeproject.com/Articles/863/Your-first-C-Web-Service
Hope it helps you.
希望它能帮到你。
#1
2
No.
没有。
Each python, java, go and now PHP runtime has a list of directly supported libraries that might have binary file dependancies. e.g. The python runtime has support for Numpy, PIL, PyCrypto and a few others https://developers.google.com/appengine/docs/python/tools/libraries27
每个python,java,go和now PHP运行时都有一个直接支持的库列表,这些库可能具有二进制文件依赖性。例如python运行时支持Numpy,PIL,PyCrypto和其他几个https://developers.google.com/appengine/docs/python/tools/libraries27
Java has a whitelist of aceptable base/core classes, upon which everything else is built. You can include your own jars, but only if the call whitelisted classes when trying to interact with the machine, network etc... - ie there are no GUI classes (like swing).
Java有一个aceptable基础/核心类的白名单,在其上构建其他所有内容。你可以包括你自己的罐子,但只有当试图与机器,网络等交互时,呼叫列入白名单... - 即没有GUI类(如swing)。
You can't just upload and call some arbitrary binary object, in your case a windows DLL, or some linux shared library. One of appengines strengths in fact is the secure sandbox.
你不能只是上传和调用一些任意的二进制对象,在你的情况下是一个Windows DLL,或者一些linux共享库。事实上,其中一个优势是安全的沙箱。
Some basic reading of the introduction to appengine docs for any of the runtimes will give you a feel for what you can and can't do. The environment is changing over time, until recently you couldn't make outbound socket calls. I seriously doubt however you will be able to ever just install/run some abritrary binary object that has been built for some other platform.)
对任何运行时的appengine文档介绍的一些基本阅读将让您感觉到您能做什么和不能做什么。环境随着时间的推移而变化,直到最近您无法进行出站套接字调用。我严重怀疑你是否能够安装/运行一些为其他平台构建的abritrary二进制对象。)
#2
2
While not a GAE specialist, I do believe you may be able to access C# methods if they are exposed as a WebService.
虽然不是GAE专家,但我相信如果它们作为WebService公开,您可以访问C#方法。
Here´s a post about how to do it via Python: http://www.bloing.net/2011/01/soap-webservice-gae-python-howto/
这是一篇关于如何通过Python实现的文章:http://www.bloing.net/2011/01/soap-webservice-gae-python-howto/
And here, how to create a c# WebService: http://www.codeproject.com/Articles/863/Your-first-C-Web-Service
在这里,如何创建一个c#WebService:http://www.codeproject.com/Articles/863/Your-first-C-Web-Service
Hope it helps you.
希望它能帮到你。