Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

SOAP and XML in PHP

Spacemail by SpaceshipSpacemail by Spaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

kubativity

Established Member
Impact
49
Hello,

does anybody here have any experience with SOAP in PHP? I am creating a soap server and client to communicate data and I have few questions.

The main question is:

how can I return a dataSet such as a table result of an SQL querry?

I see a lot of examples online of a SOAP communication that returns a single value, So I am wondering how to format the response to return something like a recordset.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
With a proper delimiter between different data values you can achieve that.

Maybe the client side using this API needs to set it that way that the data grabbed will be again pass through some function and will be available as array for using it in their codes.

Thanks.
 
1
Close
Thanks nick,


So is there a way to send back an XML dataset within your soap response message:

Code:
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> 

   <soap:Body xmlns:m="http://www.example.org/stock">
    <m:GetStockPriceResponse>
      <m:Price>34.5</m:Price>

       

    </m:GetStockPriceResponse>

 [COLOR=Red]    ...... XML formatted Data SET here ?[/COLOR]
  </soap:Body>

</soap:Envelope>

*Code sample taken from W3schools
 
0
Close
Yes and with using some PHP string functions and arrays on both the client and server side you will be able to achieve the proper results.
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
CryptoExchange.com
Domain Recover

NamePros updates

Quick replies: search, your most used replies, and more on every post
Quick replies are easier to find and use now. The quick reply menu has a search box. Type a few letters to find the reply you want. A...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back