Using SOAP Extension in non-WSDL Mode

This section provides a tutorial example on how to use SOAP client functions to make Web service call without using the WSDL standard on the target SOAP node and print detailed debug information.

I think we had enough fun with the WSDL mode. Let's try the non-WSDL mode now. Here is the third version of my Get_Temperature.php SOAP client program, Hello_There_Non_WSDL.php:

#  Hello_There_Non_WSDL.php
#- Copyright 2009-2015 (c) All Rights Reserved.
   $client = new SoapClient(null, array(
      'location' =>
      'uri'      => "",
      'trace'    => 1 ));

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

   $return = $client->__soapCall("Hello",array());
   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());

If you run this sample script, you will get:

Dumping client object:
object(SoapClient)#1 (4) {
  string(34) ""
  string(51) ""

Returning value of __soapCall() call:
Dumping request headers:
POST /Service/Hello_SOAP_11.php HTTP/1.1
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 399

Dumping request:
<?xml version="1.0" encoding="UTF-8"?>

Dumping response headers:
HTTP/1.1 200 OK
Server: Apache
Keep-Alive: timeout=2, max=200
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml

Dumping response:
      Hello from server -

The output shows that:

Table of Contents

 About This Book

 Introduction and Installation of PHP

 PHP Script File Syntax

 PHP Data Types and Data Literals

 Variables, References, and Constants

 Expressions, Operations and Type Conversions

 Conditional Statements - "if" and "switch"

 Loop Statements - "while", "for", and "do ... while"

 Function Declaration, Arguments, and Return Values

 Arrays - Ordered Maps

 Interface with Operating System

 Introduction of Class and Object

 Integrating PHP with Apache Web Server

 Retrieving Information from HTTP Requests

 Creating and Managing Sessions in PHP Scripts

 Sending and Receiving Cookies in PHP Scripts

 Controlling HTTP Response Header Lines in PHP Scripts

 Managing File Upload

 MySQL Server Connection and Access Functions

 Functions to Manage Directories, Files and Images

SOAP Extension Function and Calling Web Services

 PHP Implementations of SOAP

 Turning on the Default SOAP Extension

 Hello_There.php - First Example of SOAP

 SoapClient - SOAP Client Class and Functions

 Hello_There_Dump.php - Debugging SOAP Messages

 What Is WSDL

Using SOAP Extension in non-WSDL Mode

 SOAP Server Functions and Examples

 Localization Overview of Web Applications

 Using Non-ASCII Characters in HTML Documents

 Using Non-ASCII Characters as PHP Script String Literals

 Receiving Non-ASCII Characters from Input Forms

 "mbstring" Extension and Non-ASCII Encoding Management

 Managing Non-ASCII Character Strings with MySQL Servers

 Parsing and Managing HTML Documents

 Configuring and Sending Out Emails

 Image and Picture Processing

 Managing ZIP Archive Files

 Managing PHP Engine and Modules on macOS

 Managing PHP Engine and Modules on CentOS

 Archived Tutorials


 Full Version in PDF/EPUB