User Contributed Notes 14 notes

If anyone is trying to use this for accessing Sabre's web services, it won't work. Sabre checks the request header "Content-Type" to see if it is "text/xml" . If it is not text/xml then it sends an error back.

You will need to create a socket connection and use that to send the request over.

PROBLEM (with SOAP extension under PHP5) of transferring object, that contains objects or array of objects. Nested object would not transfer.

SOLUTION:This class was developed by trial and error by me. So this 23 lines of code for most developers writing under PHP5 solves fate of using SOAP extension.

<?php/*According to specific of organization process of SOAP class in PHP5, we must wrap up complex objects in SoapVar class. Otherwise objects would not be encoded properly and could not be loaded on remote SOAP handler.

So every class, which will transfer via SOAP, must be extends from class SOAPable. As you can see, in code above, function prepareSOAPrecursive search another nested objects in parent object or in arrays, and if does it, tries call function getAsSOAP() for preparation of nested objects, after that simply wrap up via SoapVar class.

SoapFault exception: [SOAP-ENV:Client] looks like we got no XML document

This error can have to reasons:1: Your server script has some hidden output like spaces before or afher <?php ... ?> or echoing some text2: You have a bug in your server script; resulting in a error message output

Test your server script by calling it direct from the browser.The result should be a clean output like :

This tell's you there was a request but without data; This is OKNow if you get the error when calling with your soap client;remember that your server now will call other functions in the server.php script because it now has some data to process

If you are having an issue where SOAP cannot find the functions that are actually there if you view the wsdl file, it's because PHP is caching the wsdl file (for a day at a time). To turn this off, have this line on every script that uses SOAP: ini_set("soap.wsdl_cache_enabled", "0"); to disable the caching feature.

This error occurs because some versions of PHP SOAP client do not send the user name and password that you pass as the options input parameter of the SoapClient constructor . Yu need to pass the credentials in the web service URL like this:
$soapClient =new SoapClient(“http://user:password@example.com/blahblah.wsdl”);

We've a JAVA WebService Server which could have attached documents. When the PHP Client send the dates, the Server take it correctly, but when the server return it to the PHP Client, the client reply always that is not a XML valid document.

The problem could be than the JAVA Server adds (to this type of XML binary files) the documentType head: xml+xop and the clean doesn't understandthis head as a XML document.

There is some possibility to solve this problem in the PHP Client without doing changes in the JAVA Server?