I'm a beginner php developper, i have a project basing on php and mysql and i want to add some webservices to this project to get some data.
I want to use SOAP with WSDL definitions to define my services,i'm using nusoap library.
For exemple, i have a table "product(id,designation,price,category)
" when the user (soap client) want to get the list of all product with category "X" sent as parameter to the webservice.
the part of php/mysql code is done and i got the result as an array, then i need to send this array multidimensional in the response.
The body of the soap Envelope must be like this:
<SOAP-ENV:Body>
<ns1:getProductResponse xmlns:ns1="http://localhost/sttpb/services/getProduct.php">
<return xsi:type="xsd:string">
<Product>
<id>1</id>
<designation>Product 1</designation>
<price>10</price>
</Product>
<Product>
<id>2</id>
<designation>Product 2</designation>
<price>10</price>
</Product>
<Product>
<id>3</id>
<designation>Product 3</designation>
<price>10</price>
</Product>
</return>
</ns1:getProductResponse>
</SOAP-ENV:Body>
Someone can help me with the easiest way to done this job ?