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) 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]
blog comments powered by Disqus |