502 CHAPTER 20 WEB SERVICES When debugging

502 CHAPTER 20 WEB SERVICES When debugging via the client, you can begin accessing debugging information via the property debug_str, like so: echo $client->debug_str; Because the returned string is quite lengthy, it will be difficult to read if you output it to the browser. You can improve its readability by replacing all newline characters with the br tag via the nl2br() function: echo nl2br($soapclient->debug_str); When debugging via the server, the debugging information will automatically be appended to any response. Interestingly, you can also enable server debugging from the client side by appending ?debug=1 to the Web Service endpoint URL. This causes the server to automatically append the debugging information to the response, as if debugging were enabled on the server side. Two additional debugging attributes are available to the client: request: Retrieves the request header and accompanying SOAP message. It s called like so: echo $soapclient->request; response: Retrieves the request response header and its accompanying SOAP message. It s called like so: echo ‘

‘.$soapclient->response.’‘; Secure Connections Security should always be a subject of considerable concern when developing Internet-based applications. One of the de facto security safeguards in widespread use today is the Secure Sockets Layer (SSL) protocol, used to encrypt traffic sent over the Internet. NuSOAP supports SSL connections if the cURL extension is configured for PHP. Due to this extension s popularity, it s been bundled with PHP 5, and is enabled by configuring PHP with the –with-curl option. Secure connections are initiated as is done via the Web browser, by prefacing the domain address with https rather than http. PHP 5 s SOAP Extension In response to the community clamor for Web Services enabled applications, and the popularity of third-party SOAP extensions, a native SOAP extension was incorporated into PHP 5. This section introduces this new object-oriented extension, offering several examples demonstrating how easy it is to create SOAP clients and servers. Along the way, you ll learn more about many of the functions and methods available through this extension. Before you can follow along with the accompanying examples, you need to take care of a few prerequisites, which are discussed next.
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

Leave a Reply