Pro PHP- Patterns, Frameworks, Testing and More

(vip2019) #1

(^292) CHAPTER 19 ■ INTRODUCTION TO WEB SERVICES WITH SOAP
■Note If you do not want to work with WSDL files on the client side, you can provide null as a parameter
to work in non-WSDL mode. If you do that, you will need to set the location and URI options explicitly.
The soapCall() method calls a SOAP operation. Typically, you will just use the operation
name as a method of the SoapClient class, but if you need extra functionality, you may use
soapCall() instead.
Ta b l e 19 - 1. SoapClient::__construct() Options
Option Description
uri The target namespace of the web service (http://localhost/demo).
location The URL where the service exists (http://localhost/service.php).
style In non-WSDL mode, can be used to provide the document style.
use In non-WSDL mode, can be used to define the document use.
soap_version The SOAP version to use. Use the constant SOAP_1_1 or SOAP_1_2.
login HTTP authentication login.
password HTTP authentication password.
proxy_host The host of a proxy to connect through.
proxy_port The proxy port.
proxy_login The proxy login.
proxy_password The proxy password.
local_cert Used in SSL authentication (covered in Chapter 21).
passphrase The password for the SSL key provided by local_cert.
compression Enables the compression of SOAP requests. There are various
constants defining different SOAP compression techniques,
including SOAP_COMPRESSION_ACCEPT, SOAP_COMPRESSION_GZIP,
and SOAP_COMPRESSION_DEFLATE.
encoding Defines the internal character encoding. Will convert received strings
into the provided encoding.
classmap Maps WSDL types to PHP classes. The format of this parameter is an
associative array with WSDL types as keys and class names as values
(covered in Chapter 20).
trace Enables or disables the tracing of SOAP requests. See Listing 19-7.
exceptions Enables or disables the throwing of exceptions when a SoapFault
condition is met.
connection_timeout Number of seconds to wait for a connection to the SOAP service.
McArthur_819-9.book Page 292 Friday, February 29, 2008 8:03 AM

Free download pdf