0

I am very new to SOAP and struggling with this!

I am calling for a SOAP response from an sql database

$client = new SoapClient("url......");
$soapquery = array('CoCode' => $cocode, 'WAPassword' => $webpass, 'strSQL' => $sqlt);
$soapresult = $client->SQL($soapquery);
$balance = $soapresult->SQLResult;
print_r($balance);

The result shows in Chrome as the value requested, but when inspecting the source it shows as an xml

<NewDataSet>
  <Table>
    <TOTAL>3348.1200</TOTAL>
  </Table>
</NewDataSet>

How can i get this information into either a PHP string or if i am calling more than one field into an array?

Thanks in advance.

1 Answer 1

1

I don't know why soapClient isn't parsing your response, but for a quick fix, you can use the php function simplexml_load_string.

Here is an example: How to parse SOAP response without SoapClient

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.