Web Service - Have I got the wrong Idea?
Posted: Thu Feb 18, 2010 6:27 am
Fist up, I've never made a web service before. This will be apparent in the following question!
We have a web application (All written in PHP) that requires a web service for communicating with other systems and websites. This site was written a while ago and is loosely based on the MVC design pattern.
The application is quite large, and works like a restful web service already. Each page is generated by calling the main page with arguments telling it which page to render. The arguments tell the main page the location of the main PHP file (used for producing all the XML for the page) and the XSL template for that page. Using these arguments the main page handles the XSL-T and displays the resulting page.
I believe that a web service should be almost a separate system from the main application. It's sole function should be to receive requests (either via SOAP message, or HTTP for restful services) and take action on them, in this case returning requested information from the databse in XML format or by adding information to the database.
However I'm being told by other people (who's opinion I don't really respect if I'm honest) that the web service should be built into the main page used by the application to render pages. Personally I feel this would remove some of the ambiguity of how the system works (possibly leading to security issues) and will result in a massive main page which will be difficult to maintain as it will be used for both the web service and application page generation.
Which method is the correct way? Am I barking up the wrong tree completely? Does anyone recommend web sites or books that can help on the matter?
Thanks in advance for responses!
We have a web application (All written in PHP) that requires a web service for communicating with other systems and websites. This site was written a while ago and is loosely based on the MVC design pattern.
The application is quite large, and works like a restful web service already. Each page is generated by calling the main page with arguments telling it which page to render. The arguments tell the main page the location of the main PHP file (used for producing all the XML for the page) and the XSL template for that page. Using these arguments the main page handles the XSL-T and displays the resulting page.
I believe that a web service should be almost a separate system from the main application. It's sole function should be to receive requests (either via SOAP message, or HTTP for restful services) and take action on them, in this case returning requested information from the databse in XML format or by adding information to the database.
However I'm being told by other people (who's opinion I don't really respect if I'm honest) that the web service should be built into the main page used by the application to render pages. Personally I feel this would remove some of the ambiguity of how the system works (possibly leading to security issues) and will result in a massive main page which will be difficult to maintain as it will be used for both the web service and application page generation.
Which method is the correct way? Am I barking up the wrong tree completely? Does anyone recommend web sites or books that can help on the matter?
Thanks in advance for responses!