SOAP Web Service Tutorials - Herong's Tutorial Examples - v5.13, by Herong Yang
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) 2007 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:
herong> php NumberConversion.php Result: one hundred and one
Very nice. This confirms that:
Table of Contents
Introduction to SOAP (Simple Object Access Protocol)
SOAP Message Transmission and Processing
SOAP MEP (Message Exchange Patterns)
►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
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
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