Zend
  Home arrow Zend arrow Page 3 - PHP SOAP Extension
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Forums Sitemap 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
ZEND

PHP SOAP Extension
By: Zend
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 20
    2004-03-17


    Table of Contents:
  • PHP SOAP Extension
  • A First SOAP Client
  • Using WSDL
  • A First SOAP Server
  • Creating the Server
  • Example 6
  • Example 8 (client5.php)
  • Other Implementations of SOAP for PHP

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    PHP SOAP Extension - Using WSDL
    (Page 3 of 8 )


    Here is the same PHP SOAP client, rewritten using that WSDL document. Now we don’t need to specify the endpoint URI, namespace, SOAPAction header, encoding style and parameter types. All the information comes from the WSDL file.

    Example 2 (client2.php)


    <?php
     $client 
    = new SoapClient("http://services.xmethods.net/  soap/urn:xmethods-delayed-quotes.wsdl);
      print($client->getQuote("
    ibm"));
    ? >


    That’s a little easier, isn’t it?
    What are the problems with WSDL? The only argument against using it is that the client has to load the relevant WSDL document from the server before the RPC can be made, and this can take a significant amount of time in a Web environment. In order to speed things up, PHP’s ext/soap uses a WSDL caching feature that can be controlled through setting the soap.wsdl_cache_enabled, soap.wsdl_cache_dir and soap.wsdl_cache_ttl configuration directives, either in your  php.ini or by using ini_set()(see Example 4) ). By default, WSDL caching is turned on and caches WSDL files for one day.
    Here is the SOAP section for php.ini with default values.  You can paste it into your php.ini.

    [soap]
    soap.wsdl_cache_enabled "1"
    enables or disables WSDL caching feature
    soap
    .wsdl_cache_dir "/tmp"
    sets the directory name where SOAP extension will put cache files
    soap
    .wsdl_cache_ttl "86400" 
    ; (time to livesets the number of second while cached file will be used
    instead of original one



     
     
    >>> More Zend Articles          >>> More By Zend
     

       

    ZEND ARTICLES

    - Taking the Zend Certified PHP Engineer Exam:...
    - Quick Introduction to PHP 5
    - PHP SOAP Extension
    - Improving Performance
    - PDFs with PHP part 2
    - PDFs with PHP part 1
    - PHP at Lycos
    - Build Database Interfaces





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek