The SoapServer class

- « SoapClient::__soapCall

- SoapServer::addFunction »

- PHP Manual
- SOAP
- The SoapServer class

# The SoapServer class

(PHP 5, PHP 7, PHP 8)

## Introduction

The SoapServer class provides a server for the » SOAP 1.1 and » SOAP 1.2 protocols. It can be used with or without a WSDL service description.

## Class synopsis

class SoapServer {
/* Properties */
private ?SoapFault $__soap_fault = null;
/* Methods */
public __construct(?string `$wsdl`, array `$options` = [])
public addFunction(array|string|int `$functions`): void
public addSoapHeader(SoapHeader `$header`): void
public fault(
string `$code`,
string `$string`,
string `$actor` = "",
mixed `$details` = `null`,
string `$name` = ""
): void
public getFunctions(): array
public handle(?string `$request` = `null`): void
public setClass(string `$class`, mixed `...$args`): void
public setObject(object `$object`): void
public setPersistence(int `$mode`): void
}

## Properties

service

__soap_fault

## Table of Contents

- SoapServer::addFunction — Adds one or more functions to handle SOAP requests
- SoapServer::addSoapHeader — Add a SOAP header to the response
- SoapServer::__construct — SoapServer constructor
- SoapServer::fault — Issue SoapServer fault indicating an error
- SoapServer::getFunctions — Returns list of defined functions
- SoapServer::handle — Handles a SOAP request
- SoapServer::setClass — Sets the class which handles SOAP requests
- SoapServer::setObject — Sets the object which will be used to handle SOAP requests
- SoapServer::setPersistence — Sets SoapServer persistence mode