0

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 ?

zx485
  • 28,498
  • 28
  • 50
  • 59
Samir Sam
  • 1
  • 1
  • Try following https://www.sitepoint.com/web-services-with-php-and-soap-1/ – MonkeyZeus Jan 23 '18 at 14:23
  • We are always glad to help and support new coders but ***you need to help yourself first. :-)*** After [**doing more research**](https://meta.stackoverflow.com/q/261592/1011527) if you have a problem **post what you've tried** with a **clear explanation of what isn't working** and provide [a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). Read [How to Ask](http://stackoverflow.com/help/how-to-ask) a good question. Be sure to [take the tour](http://stackoverflow.com/tour) and read [this](https://meta.stackoverflow.com/q/347937/1011527). – Jay Blanchard Jan 23 '18 at 14:24

0 Answers0