470,849 Members | 1,127 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Best way to return a ADO.NET dataset to a PHP SOAP client?

Hi, I've spent quite a bit of time looking into this, but am having
trouble finding a straighforward solution.

What is the best/recommended way to return an ADO.NET data set to a PHP
SOAP client?

I've been using stuff like:

Dim dsWhatever as Dataset
[...]
Return dsWhatever.GetXML

and that sends back a string of nice XML which I can parse without too
much trouble in PHP. It works fine, but it seems like there is probably
a better way to do this that I am not aware of.

Thoughts?

Thanks,

Alan

Mar 2 '06 #1
1 3526
Nevermind. I figured it out.

In case any other newbies are wondering about this in the future:

You can just use:

Return dsWhatever

in your webservice. Note that this returns an *array* to PHP, not XML.
The XML you're expecting is containing within the "any" element of the
returned array (which also has a "schema" element.

So you on the PHP end, you can get the results and pull the XML out of
the array using:

$result = $client->GetAllContactNames()->GetAllContactNamesResult;
$xml = $result->any;
$xml = simplexml_load_string($xml);
//...and so on.

And you can parse it from there. Now, there are probably some handy
SOAP-related functions in PHP5 that make it easy to parse that XML, but
I haven't gotten that far yet.

adm

ad*****@yahoo.com wrote:
Hi, I've spent quite a bit of time looking into this, but am having
trouble finding a straighforward solution.

What is the best/recommended way to return an ADO.NET data set to a PHP
SOAP client?

I've been using stuff like:

Dim dsWhatever as Dataset
[...]
Return dsWhatever.GetXML

and that sends back a string of nice XML which I can parse without too
much trouble in PHP. It works fine, but it seems like there is probably
a better way to do this that I am not aware of.

Thoughts?

Thanks,

Alan


Mar 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Brian Keating | last post: by
reply views Thread by Sham Ramakrishnan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.