A PHP-based SOAP web service template designed for secure data management and flexible query handling. This project enables user authentication, database querying, and XML response formatting, making it suitable for a range of applications requiring structured data exchange with external systems.
- SOAP Web Service: Built on PHP's SOAP server functionality, adhering to WSDL for structured communication.
- User Authentication: Login through database validation.
- Database Querying: Executes parameterized SQL queries to prevent SQL injection attacks.
- XML Response Formatting: Outputs data in an XML structure for easy integration with consuming applications.
-
Clone this repository to your local server environment:
git clone https://github.com/akartals/PHP-SOAP-server-client-template.git
-
Navigate to the project directory:
cd PHP-SOAP-server-client-template -
Configure the database:
- Import the soapwdsl.sql to your server.
-
Update
./helpers/database.phpwith your database connection details. -
Place
test.wsdlin the root directory. -
Update the Server URL:
- Locate any instances of
http://localhost/soaptestin files and replace them with your server’s URL (e.g.,https://yourserver.com/soaptest).
- Locate any instances of
You can use the client.php for retrieving data from server.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:koc="Kocatepe">
<soapenv:Header/>
<soapenv:Body>
<koc:GetBookList>
<request>
<username>akartals</username>
<password>123456</password>
<type>roman</type>
</request>
</koc:GetBookList>
</soapenv:Body>
</soapenv:Envelope>- Implement WSS for encrypted authentication
- Hash user passwords