PHP - XML - "API"?
Posted: Mon Aug 23, 2010 1:19 pm
Hello Devnetwork users,
I need to test the communication between several workstations using a browser, with what I call right now an "API".
Here's what I've done so far:
USING PHP
1) Upload a picture form. Write a name for the picture
2) When user uploads the picture, the app renames the file to the one given by the user, and then generates an XML with the name of the file, the ip of the workstation, and the image itself in base64.
3) The XML is saved on a /xml folder with "name.xml"
4) The image is saved on a /image folder with "name.xxx" (xxx = jpg, gif...etc)
The PHP shows (after submission):
- XML content
- name an folders where the files were saved.
SO... Now the "API" comes to work, and this is where I am stuck...
5) The PHP app should alert the "API" to pick up the /xml/name.xml .
6) The "API" should read the alert, and pick up the file.
7) The "API" will check the xml, if it is "understandable" and then return a "Flag" to the PHP app
The PHP app should display in the screen, the response of the "flag" after showing the XML content.
So, my questions are:
a) Should I use PHP as the "API"? I tried with http-request but I noticed it is now disabled in PHP 5.3.1
b) What other programming language do you suggest?
c) If this is not an "API" how would you call it?
Keep in mind that the "API" receives an xml, and returns a positive or negative answer, but doesn't interact directly with the user.
Thank you all for your valuable help!!!
I need to test the communication between several workstations using a browser, with what I call right now an "API".
Here's what I've done so far:
USING PHP
1) Upload a picture form. Write a name for the picture
2) When user uploads the picture, the app renames the file to the one given by the user, and then generates an XML with the name of the file, the ip of the workstation, and the image itself in base64.
3) The XML is saved on a /xml folder with "name.xml"
4) The image is saved on a /image folder with "name.xxx" (xxx = jpg, gif...etc)
The PHP shows (after submission):
- XML content
- name an folders where the files were saved.
SO... Now the "API" comes to work, and this is where I am stuck...
5) The PHP app should alert the "API" to pick up the /xml/name.xml .
6) The "API" should read the alert, and pick up the file.
7) The "API" will check the xml, if it is "understandable" and then return a "Flag" to the PHP app
So, my questions are:
a) Should I use PHP as the "API"? I tried with http-request but I noticed it is now disabled in PHP 5.3.1
b) What other programming language do you suggest?
c) If this is not an "API" how would you call it?
Keep in mind that the "API" receives an xml, and returns a positive or negative answer, but doesn't interact directly with the user.
Thank you all for your valuable help!!!