NameSilo

SOAP and XML in PHP

SpaceshipSpaceship
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
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back