note 111682 deleted from soapclient.soapclient by crell
| From: | crell@php.net | Date: | Mon, 04 Apr 2022 16:51:23 +0000 |
| Subject: | note 111682 deleted from soapclient.soapclient by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218104@lists.php.net to get a copy of this message | ||
Note Submitter: francesco [at] paladinux [dot] net
----
Where you have the problem of
"looks like we got no XML document SoapClient", really the real problem is the xml code
from remote server is not clear (after last tag is possible that you have space or other caracter
that the your supplier of service have lost : no one is perfect!)
I've read some solution, like here, but you must to know that is possible, that is possible
that the remote server don't wrong, and the "surplus" (latin word for added values)
is needed.
In particolar with axis Java server, is possible that the configuration of server is needed and the
"surplus" is one or more attachments...
The solution is 3:
1) contact your supplier if is possible to remove caracter if is an error (good luck! ;) )
2) use another class like nusoap resolve the problem (but has other problem!)
3) this technical solution:
when call the wsdl be sure that the option trace and exceptions are setted (the first true and the
second false)
<?php
$SoapClient = new SoapClient(NULL,
array(
....
'trace' => 1,
'exceptions' => 0
)
?>
(if you don't do that you can't use the __getLastResponse)
Now You can do the request and use __getLastResponse() to obtain all the part..
<?php
$result = $SoapClient -> problematicCall($par);
?>
After all you obtain a variable like that:
-----=_Part_9325_126764118.1363377774664
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: <1C06F7FBA057796C5A6185605F9F93E4>
<?xml version="1.0" encoding="utf-8"?><...etc ><?xml
version="1.0" encoding="UTF-8"?>
<MESSAGGIO>
<DA>MI</DA>
<A>PALADINUX</A>
<ID>12345</ID>
<TIPODOC>RC</TIPODOC>
<RISPOSTA>
</MESSAGGIO>
</rxproblematicCallReturn></ns1:rxCatalogoMaterialiResponse></soapenv:Body></soapenv:Envelope>
------=_Part_9325_126764118.1234567890123
Content-Type: application/zip
Content-Transfer-Encoding: binary
Content-Id: <43E91F7E7PALADINUXE07BF041A7BAC9>
-------------------------
Is easy understand if the added part is needed or not!
Now you can explode all the part and parse!
Hope this can help you.See ya in the cyberspace!