GetTempDump.php - Dumping Debugging Information

This section describes a tutorial example of how to dump debugging information within a client side SOAP application.

After learning the basic functions of the SoapClient class, I rewrote the GetTemp.php client program to get more information on how SOAP Extension works, and to show you how to debug information. The new client program is called, GetTempDump.php:

<?php # GetTempDump.php
# Copyright (c) 2005 by Dr. Herong Yang
   $zip = "123456";
   $client = new SoapClient
      array('trace' => 1));

   echo("\nDumping client object:\n");

   echo("\nDumping client object functions:\n");

   $return = $client->getTemp($zip);
   echo("\nReturning value of getTemp() call: ".$return);

   $return = $client->__soapCall("getTemp",array($zip));
   echo("\nReturning value of __soapCall() call: ".$return);

   echo("\nDumping request headers:\n" 

   echo("\nDumping request:\n".$client->__getLastRequest());

   echo("\nDumping response headers:\n"

   echo("\nDumping response:\n".$client->__getLastResponse());

Output of this program:

Dumping client object:
object(SoapClient)#1 (3) {
  resource(5) of type (Unknown)

Dumping client object functions:
array(1) {
  string(30) "float getTemp(string $zipcode)"

Returning value of getTemp() call: 52

Returning value of __soapCall() call: 52

Dumping request headers:
POST /soap/servlet/rpcrouter HTTP/1.1
Connection: Keep-Alive
User-Agent: PHP SOAP 0.1
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 510
Cookie: JSESSIONID=uuqkGDvtzw_IPlMLsodnVX9j;

Dumping request:
<?xml version="1.0" encoding="UTF-8"?>
  <zipcode xsi:type="xsd:string">123456</zipcode>

Dumping response headers:
HTTP/1.1 200 OK
Server: Enhydra-MultiServer/3.1.1b1
Status: 200
Content-Type: text/xml; charset=utf-8
Servlet-Engine: Enhydra Application Server/3.1.1b1 (JSP 1.1; 
   Servlet 2.2; Java 1.4.2_03; Linux 2.4.7-10smp i386; 
   java.vendor=Sun Microsystems Inc.)
Content-Length: 470
X-Cache: MISS from
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive

Dumping response:
<?xml version='1.0' encoding='UTF-8'?>
<ns1:getTempResponse xmlns:ns1="urn:xmethods-Temperature-Demo" 
<return xsi:type="xsd:float">52.0</return>

The output is very useful. It confirms that:

Last update: 2007.

Table of Contents

 About This Book

 Introduction to Web Service

 Introduction to SOAP (Simple Object Access Protocol)

 SOAP Message Structure

 SOAP Message Transmission and Processing

 SOAP Data Model

 SOAP Encoding

 SOAP RPC Presentation

 SOAP Properties Model

 SOAP Message Exchange Patterns

 SOAP HTTP Binding

 SOAP Perl Implementations

 SOAP PHP Implementations

 SOAP Java Implementations

 Perl SOAP::Lite - SOAP Server-Client Communication Module

 Perl Socket Test Program for HTTP and SOAP

 Perl SOAP::Lite for GetSpeech SOAP 1.1 Web Service

 Perl SOAP::Lite 0.710 for SOAP 1.2 Web Services

 Perl SOAP::Lite 0.710 for WSDL

PHP SOAP Extension Client Programs

 What Is PHP SOAP Extension?

 GetTemp.php - First Example with SOAP

 PHP SOAP Extension Functions for Client Programs

GetTempDump.php - Dumping Debugging Information

 Whis Is WSDL (Web Services Definition Language)?

 Using SOAP Extension in non-WDSL Mode

 PHP SOAP Extension Server Programs

 Java Socket and HttpURLConnection for SOAP

 SAAJ - SOAP with Attachments API for Java

 SoapUI - SOAP Web Service Testing Tool

 WS-Security - SOAP Message Security Extension

 WS-Security X.509 Certificate Token

 Web Services and SOAP Terminology


 PDF Printing Version