Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Integrating PHP with .NET - How?

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
A task just landed on my laps and it involves integrating a PHP based application with a .NET based application. Applications are hosted at different servers/intranet/extranet ...

I've looked around and two things popped up: PHP SOAP and NUSOAP (I also found
If anyone here has done something like this, I would very much appreciate a bit, or a lot ;-), of help. The task, for now, is simple enough: SEND/RECEIVE data.

Thank you all in advance for your assistance!





--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
assuming the data is stored in a database why not just access the databases directly (remotely) over SSH or some other method?
 
I do not think this is even an option, but I will ask.

I sure hope that this is NOT the only shot I have!

--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
no. but it is likely to be the most robust and possibly secure. particularly if the integrity of the shared data is important.

the usual alternative is to build a web service on the served that houses the data store that you want to access. depending on your needs soap is an option. but so is a simple script that accepts name value pairs to build a query and return data (typically in json as a good cross platform exchange mechanism). essentially you are emulating a web form. the web service can be accessed via get using file_get_contents with the http protocol wrapper or if you need to use post then you will need to use the curl extension. remember that if security is important between the servers then it would be best for you to create an SSH port redirect on the client machine to manage the interchange.
 
So, when you say using SSH, do you mean running SQL commands over a secured connection?

--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
running whatever over a secure connection.

if you can then it makes sense to address the database directly from the remote server. again an SSH port redirect is a good way to do this.

but even if you are using a web service if the data is important to keep private then you will want to use some method of securing the connection between client and server whether this is through https (with authentication credentials) or SSH (with limited execution rights).

of course if you don't care about the data and don't mind if the web service starts being abused/used publicly then there is no harm in making it plain http.


often using https interferes with running multiple vhosts which is why I guess that I use ssh tunnels. the downside of the tunnels is that they have to be instantiated outside of the web server (typically during a start up routine) or the like. or rather it makes more sense to keep them Olen like that.

if the data is relatively static then it may male more sense for you to extract a copy in the quiet hours and transpose it to a local table. I do this for statistic servers. a crown job attaches to the live instance of a clients dB cluster and takes a snapshot then copies it to the stats server drops all the local tables and rebuilds from the remote dump. this is important because running perfromance and economic analytics on a dataset can be quite processor intensive and hurt the app responsiveness in peak hours.

if you give us some.more context we may be able to.help a bit more.
 
Remote server already has a .NET and a SOAP API, hence why I was looking for .NET integration with PHP and how I came across NUSOAP for PHP as per my original post.

Data is not that critical ... I will do a bit more leg work and advise later!

Thanks!!!!!

--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
if the.net server already exposes its methods by a soap api the. you can use soap or curl from php to access that api. it is not integration but just consuming a web service on one machine that is offered by another.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top