0

I've got a SSL connection working with my website alongside PHP sessions. I have created my own connection class to provide a single sign on, allowing my user to then interface with php script outputs from my website. I have a question though, currently I use my PHP scripts which query the database and formats the data into a HTML page, which my program then reads over the SSL connection. My program has to parse the data which may be slow for large data volumes. My question is:

without having to radically change my system architecture, is there a way to make passing the data between the server and the C# application more efficient. Currently I'm using string delimiter parsing to extract data in a way similar to command seperated values (CSR).

I've heard the word JSON passed around alot, but I think I might as well use XML instead.

SERVER: MySQL, PHP, APACHE

Thanks Thomas

friartuck
  • 2,954
  • 4
  • 33
  • 67

1 Answers1

0

What you want to research is c# web applications and a SOA architecture. JSON or SOAP will be the transfer protocol on which your PHP will talk to your C#. What you will need to do if you decide to use soap is make a c# web service as an endpoint between your PHP and your database and the c# will talk to the DB and pass the data to the PHP. you may want to look into caching as well but that's only if you need scalablity. One thing that is nice about PHP 5 is that it has a built in method to talk to the soap protocal which just turns it into an array of values passed from your C# it makes it very easy to do. What your going to need to happen with your PHP is you will need to replace the SQL querys with SOAP connections. One more thing to consider is a WCF service because webservices have been "deprecated" in anything above .net 3.5. Hopefully it shouldn't be too painful

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

Scroll down a little on this page it has some good examples for your calls.

JSON is suppose to be a quicker protocol then SOAP I just do not have alot of experience with it myself.

Handling data in a PHP JSON Object

SOA the main concept apply to c# as well http://www.javaworld.com/javaworld/jw-06-2005/jw-0613-soa.html

I am not 100% sure about c# and mysql connections I am sure there is stuff out there for it. I think the biggest problem you may have is hosting a C# service on an apache server.

Maybe check into using JAVA web services, I know it works well with apache and mysql and is used by alot of major websites.

Community
  • 1
  • 1
EntryLevel
  • 215
  • 1
  • 4
  • 11