Calling WSDL Operation Directly

This section provides a tutorial example on how to call an operation defined in a WSDL document as an object function on the SoapClient object created from the WSDL document.

The quickest way to call SOAP Web service with the SoapClient class is to use the RPC style as described below:

Here a good example of a client program, NumberConversion.php, on how to call an WSDL operation as an SoapClient object function. The NumberConversion Web service and its WSDL document are provided by dataaccess.com.

<?php # NumberConversion.php
# Copyright (c) 2018 HerongYang.com, All Rights Reserved.
#
   $client = new SoapClient
("https://www.dataaccess.com/webservicesserver/numberconversion.wso?WSDL");
   $result = $client->NumberToWords(array('ubiNum'=>101));
   echo("Result: ".$result->NumberToWordsResult."\n");
?>

When running it, I am getting:

C:herong>php NumberConversion.php

Result: one hundred and one

Very nice. This confirms that:

Last update: 2018.

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 MEP (Message Exchange Patterns)

 SOAP HTTP Binding

 SOAP PHP Implementations

PHP SOAP Extension Client Programs

 PHP SOAP Extension Functions for Client Programs

Calling WSDL Operation Directly

 Call WSDL Operation with SoapClient::__soapCall()

 Dumping SOAP Request and Response

 Call WSDL Operation with SoapClient::__doRequest()

 PHP SOAP Extension Server Programs

 PHP SOAP Web Service Example - getTemp

 SOAP Perl Implementations

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

 Perl Socket Test Program for HTTP and SOAP

 Perl SOAP::Lite for NumberToWords SOAP 1.1 Web Service

 Perl SOAP::Lite for SOAP 1.2 Web Services

 Perl SOAP::Lite for WSDL

 SOAP Java Implementations

 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

 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

 Web Services and SOAP Terminology

 Outdated Tutorials

 References

 Full Version in PDF/EPUB