W
W
WebDev2014-12-07 17:50:30
PHP
WebDev, 2014-12-07 17:50:30

What could be the problem with SOAP?

Hello, I ran into a problem: when trying to connect via SOAP, the error "looks like we got no XML document" appears. And when you run the script from the local machine, everything is in order. And on the fighting server an error. From this I conclude that there is probably something with the php setting. I checked that the entire section with SOAP in php.ini matches. Googled, almost all the results come down to the fact that invalid xml comes. Who faced this? Maybe some other settings in php.ini can affect this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FanatPHP, 2014-12-07
@FanatPHP

A similar case was in one pioneer circle:

Young naturalists put the cockroach on the table and knocked - the cockroach heard and ran.
Then the pioneers tore off the legs of the cockroach and again knocked on the table. The cockroach remained in place.
"He doesn't hear" - the young researchers guessed, and they concluded from their laboratory work: the cockroach has ears in its legs.
With the ability to draw conclusions from the observed phenomena, the users of the pophape painfully remind me of those young naturalists.
In order not to become like them, one must make one's conclusions about the reasons not on the basis of conjectures and insights, but on the basis of specific data.
If "something does not work", then it is necessary to connect not the imagination, but the hands.
And do not poke your finger into the sky, assuming that these are "settings", but find out what specifically does not work.
The server tells us that there is a problem with the document. This means that first of all we need to find out what we have received. That is, look with your eyes at this very document.
It is not difficult to do this - the built-in client provides such an opportunity:
<?php
$client = SoapClient("some.wsdl", array('trace' => 1));
$result = $client->SomeFunction();
echo "Ответ:\n" . $client->__getLastResponse() . "\n";

Here we see that when creating a client, you need to set the trace parameter, and when handling an error, add $client->__getLastResponse() to it.
And only after we see the result, it will be possible to draw thoughtful conclusions about the causes of the problem and possible ways to solve it.

K
KorsaR-ZN, 2014-12-08
@KorsaR-ZN

Add to the initialization parameters of SoapClient (assuming you have PHP 5.4+) the following option:
Due to hanging connections, some SOAP servers start sending broken responses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question