ASP.NET using PHP modules, Design suggestions needed

Hello,

I would like to get suggestions on the design question below.

We have a web based product with out 6 major modules.
Out of these, 2 modules are already developed in Windows server 2003, MS SQL 2008, IIS and Adobe ColdFusion.

The other 4 modules, we have the code developed in C# ASP.NET as part of another project.

1. My question is, is there a way in we can use these 4 modules developed in ASP.NET and use them together with other 2 modules?
2. If so will I be able to call the PHP/Coldfusion pages from ASP.NEt pages and viceversa
3. How will it impact on transferring the data between ASP.NEt forms and PHP forms?

Appreciate any inputs on these....
Thank you.
kinna99Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
Probably the design you want would be some sort of Application Programming Interface ("API") to allow the various modules to communicate.  Decide what will be the "controller" for the application and write that in the language of your choice, passing parameters to the modules and receiving data back from the modules.  JSON is a good tool for API communication.  RESTful designs are the easiest to get right.
0
Dave BaldwinFixer of ProblemsCommented:
As long as you are using standard HTTP POST and GET methods, any language can talk to any other.  I did a demo for another question using PHP and Classic ASP to pass info back and forth.
0
kinna99Author Commented:
Thank you for your comments.
DaveBaldwin, do you have a link to the demo you mentioned here....

Thanks.
0
Ray PaseurCommented:
Here's an example of a RESTful API.  You can call this in any language you want -- just read from the URL.  Since it's a RESTful implementation, you can also test it by typing the URL into the browser address bar.  Easy!

<?php // RAY_REST_get_last_name.php
error_reporting(E_ALL);


// DEMONSTRATE HOW A RESTFUL WEB SERVICE WORKS
// INPUT FIRST NAME, OUTPUT FAMILY NAME
// PHP CALLING EXAMPLE -- READ THE URI:
// file_get_contents('http://laprbass.com/RAY_REST_get_last_name.php?key=ABC&resp=XML&name=Ray');


// OUR DATA MODEL CONTAINS ALL THE ANSWERS - THIS COULD BE A DATA BASE - AS SIMPLE OR COMPLEX AS NEEDED
$dataModel
= array
( 'Brian'   => 'Portlock'
, 'Ray'     => 'Paseur'
, 'COBOL'   => 'Dinosaur'
, 'Dave'    => 'Baldwin'
)
;


// RESPONSE CAN BE PLAIN TEXT OR XML FORMAT
$alpha = NULL;
$omega = NULL;

// NORMALIZE AND TEST THE "resp=" ARGUMENT
if ( (isset($_GET["resp"])) && (strtoupper(trim($_GET["resp"])) == 'XML') )
{
    // PREPARE THE XML WRAPPER
    $alpha = '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL . '<response>' . PHP_EOL;
    $omega = PHP_EOL . '</response>';
}

// TEST THE 'API KEY' - THIS COULD BE A DATA BASE VALIDATION LOOKUP - AS SIMPLE OR COMPLEX AS NEEDED
$key = (!empty($_GET["key"])) ? $_GET["key"] : FALSE;
if ($key !== 'ABC')
{
    die( $alpha . 'INVALID API KEY' . $omega );
}

// LOOKUP THE FAMILY NAME
$name = (!empty($_GET["name"])) ? $_GET["name"] : 'MISSING name= PARAMETER';

// IF THE NAME FROM THE URL IS FOUND IN THE DATA MODEL
if (array_key_exists($name, $dataModel))
{
    // RETURNS THE APPROPRIATE FAMILY NAME FROM THE DATA MODEL
    die( $alpha . $dataModel[$name] . $omega );
}
else
{
    // RETURNS THE UNKNOWN NAME INDICATOR
    die( $alpha . "$name (UNKNOWN)" . $omega );
}

Open in new window

HTH, ~Ray
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave BaldwinFixer of ProblemsCommented:
No link, it's on my computer here Somewhere.  I probably posted it in the question but not on the web.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.