Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In my experience, it's not quite that simple. The built-in <a href="http://www.php.net/manual/en/book.soap.php" rel="noreferrer">PHP SOAP client</a> didn't work with the .NET-based SOAP server we had to use. It complained about an invalid schema definition. Even though .NET client worked with that server just fine. By the way, let me claim that SOAP interoperability is a myth.</p> <p>The next step was <a href="http://sourceforge.net/projects/nusoap/" rel="noreferrer">NuSOAP</a>. This worked for quite a while. By the way, for God's sake, don't forget to cache WSDL! But even with WSDL cached users complained the damn thing is slow.</p> <p>Then, we decided to go bare HTTP, assembling the requests and reading the responses with <code>SimpleXMLElemnt</code>, like this:</p> <pre><code>$request_info = array(); $full_response = @http_post_data( 'http://example.com/OTA_WS.asmx', $REQUEST_BODY, array( 'headers' =&gt; array( 'Content-Type' =&gt; 'text/xml; charset=UTF-8', 'SOAPAction' =&gt; 'HotelAvail', ), 'timeout' =&gt; 60, ), $request_info ); $response_xml = new SimpleXMLElement(strstr($full_response, '&lt;?xml')); foreach ($response_xml-&gt;xpath('//@HotelName') as $HotelName) { echo strval($HotelName) . "\n"; } </code></pre> <p>Note that in PHP 5.2 you'll need pecl_http, as far as (surprise-surpise!) there's no HTTP client built in.</p> <p><em>Going to bare HTTP gained us over 30% in SOAP request times.</em> And from then on we redirect all the performance complains to the server guys.</p> <p>In the end, I'd recommend this latter approach, and not because of the performance. I think that, in general, in a dynamic language like PHP there's <em>no benefit</em> from all that WSDL/type-control. You don't need a fancy library to read and write XML, with all that stubs generation and dynamic proxies. Your language is already dynamic, and <code>SimpleXMLElement</code> works just fine, and is so easy to use. Also, you'll have <em>less code</em>, which is always good.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload