开发者

C# dll which is inter-operable with php and java

I need to create a dll in C sharp which is interoperable with php and Tomcat/Java webs开发者_JS百科ervices.

Will the normal C# class library help me for this?

Thanks, John


Will the normal C# class library help me for this?

You could expose the class library as WCF service using the interoperable basicHttpBinding which could be consumed by PHP and Java.


I'm interpreting that as "I need to consume a web-service", in which case either use wsdl.exe, or use the "Add Web Reference..." / "Add Service Reference..." option in Visual Studio. Either approach results in appropriate proxy classes being created that represent the target service's WSDL.

This is data/protocol interoperability; note that the dll itself won't be directly usable from java / php.


Your question is a bit unclear on which way to "operability" goes. I assume you are talking about making a C# class library that will call these web services, which happens to be implemented in PHP/TomCat/Java.

And yes, the .Net Framework have excellent support for calling http endpoints. Also, if these endpoints happen to return XML data, there is excellent support for working with that too. If the services are RESTful, you even have support for that.

Update: since my initial assumption was wrong, and the interoperability must go from PHP/Java to .Net I suggest looking at how these languages can interop with COM. .Net classes can be exposed as COM classes, which further can be consumed by PHP and Java.


Maybe Im wrong about what is the question, but you can use c# assemblies in php with the DOTNET class:

http://php.net/manual/en/class.dotnet.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜