views:

629

answers:

2

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?

+1  A: 

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.

Scott M.
+1  A: 

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.

James Black
JSON is a good solution to reduce the amout of data transfered between the two layers, but the main problem is the lack of schema in a JSON response.Also, using LINQ, although is a good solution, can't be used, as the system will be deployed under Linux+Mono+Apache stack and the support for 3.5 framework on Mono is still lacking...
Antonello
The lack of a schema isn't a big deal if you always put the name of the key with the value, as you just look for particular keys and use that value.The fact that you are using Mono would have been helpful to know earlier, btw. :)Make webservice or REST calls, perhaps.
James Black