简体   繁体   中英

Interaction between PHP front-end and .NET/Java backend though XML-RPC: performances consideration

I'm implemented a solution which is constituted by a .NET back-end application based on ASP.NET: since the team that I'm considering to build should be composed of me and one or two front-end developers working in PHP.

A good side effect of this architecture is that PHP is a fast server-side scripting engine which require less resources than ASP.NET.

The only solution i've found for allowing the two layers to communicate is through XML-RPC, which is a protocol supported by both the systems (although the back-end part was implemented by me). One problem of this approach is that XML-RPC doesn't support any authentication system and has some lack of performances in the serialization/deserialization between the object notation and the XML representation.

Has anyone any consideration or alternative solution?

You could play with the idea of using JSON if your application could allow it. JSON = Javascript Object Notation. It's a very lightweight syntax for describing objects. I just used it to transfer data from a php server to clientside javascript through ajax requests in a project I just completed. It takes a bit of getting used to, however you may find it easier to work with once you figure it all out.

I would agree that JSON may be an excellent approach for passing data, but to go from PHP to .NET you may want to use xml only because then you can use XML LINQ, which may make parsing simpler.

You can then communicate back and forth via http connections or webservices, depending on which way data flows, but I expect that it will flow from PHP -> .NET, so you could experiment with WCF to pass data, using a REST architecture, though PHP can do webservice client calls also.

If you communicate back from the .NET with JSON or use a webservice response then you have a good decoupling between the two frameworks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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