ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# SOAP SOAP扩展可用于编写SOAP服务器和客户端。它支持[»SOAP 1.1](http://www.w3.org/TR/soap11/),[»SOAP 1.2](http://www.w3.org/TR/soap12/)和[»WSDL 1.1](http://www.w3.org/TR/wsdl)规范的子集 要启用SOAP支持,请使用\*\*--enable-soap\*\*配置PHP 该扩展需要[libxml](https://www.php.net/manual/en/book.libxml.php)PHP扩展 > SOAP:SOAP Web API采用RPC风格,它采用面向功能的架构,所以我们在设计SOAP Web API的时候首相考虑的是应高提供怎样的功能(或者操作)。 > REST:继SOAP之后流行 > RESTful Web API采用面向资源的架构,所以在设计之初首先需要考虑的是有哪些资源可供操作 > SOAP通常以xml描述数据而rest提倡json描述数据(xml和json都是通用格式的与语言无关,可以在不同的语言中互通) ## 运行时配置 **SOAP配置选项** 名称默认多变描述[soap.wsdl\_cache\_enabled](https://www.php.net/manual/en/soap.configuration.php#ini.soap.wsdl-cache-enabled)1个PHP\_INI\_ALL启用或禁用WSDL缓存功能[soap.wsdl\_cache\_dir](https://www.php.net/manual/en/soap.configuration.php#ini.soap.wsdl-cache-dir)/ tmpPHP\_INI\_ALL设置SOAP扩展将缓存文件放入的目录名称[soap.wsdl\_cache\_ttl](https://www.php.net/manual/en/soap.configuration.php#ini.soap.wsdl-cache-ttl)86400PHP\_INI\_ALL设置将使用缓存文件而不是原始文件的秒数(生存时间)[soap.wsdl\_cache](https://www.php.net/manual/en/soap.configuration.php#ini.soap.wsdl-cache)1个PHP\_INI\_ALL如果`soap.wsdl_cache_enabled`启用,则此设置确定缓存的类型。它可以是以下任意值:**`WSDL_CACHE_NONE`**(0),**`WSDL_CACHE_DISK`**(*1*),**`WSDL_CACHE_MEMORY`**(*2*)或\*\*`WSDL_CACHE_BOTH`\*\*(*3*)。也可以通过[SoapClient](https://www.php.net/manual/en/class.soapclient.php)或[SoapServer](https://www.php.net/manual/en/class.soapserver.php)构造函数中的`options`数组进行设置[soap.wsdl\_cache\_limit](https://www.php.net/manual/en/soap.configuration.php#ini.soap.wsdl-cache-limit)5PHP\_INI\_ALL内存中缓存的WSDL文件的最大数量。将更多文件添加到完整的内存缓存中将会从中删除最旧的文件- [SoapClient](https://www.php.net/manual/en/class.soapclient.php)— SoapClient类 - [SoapClient :: \_\_ call](https://www.php.net/manual/en/soapclient.call.php)—调用SOAP函数(不建议使用) - [SoapClient :: \_\_ construct](https://www.php.net/manual/en/soapclient.construct.php)— SoapClient构造函数 - [SoapClient :: \_\_ doRequest](https://www.php.net/manual/en/soapclient.dorequest.php)—执行SOAP请求 - [SoapClient :: \_\_ getCookies](https://www.php.net/manual/en/soapclient.getcookies.php)—获取cookie列表 - [SoapClient :: \_\_ getFunctions](https://www.php.net/manual/en/soapclient.getfunctions.php)—返回可用SOAP函数的列表 - [SoapClient :: \_\_ getLastRequest](https://www.php.net/manual/en/soapclient.getlastrequest.php)—返回上一个SOAP请求 - [SoapClient :: \_\_ getLastRequestHeaders](https://www.php.net/manual/en/soapclient.getlastrequestheaders.php)—返回上一个请求的SOAP标头 - [SoapClient :: \_\_ getLastResponse](https://www.php.net/manual/en/soapclient.getlastresponse.php)—返回上一个SOAP响应 - [SoapClient :: \_\_ getLastResponseHeaders](https://www.php.net/manual/en/soapclient.getlastresponseheaders.php)—返回上一次响应的SOAP标头 - [SoapClient :: \_\_ getTypes](https://www.php.net/manual/en/soapclient.gettypes.php)—返回SOAP类型的列表 - [SoapClient :: \_\_ setCookie](https://www.php.net/manual/en/soapclient.setcookie.php)— \_\_setCookie的目的 - [SoapClient :: \_\_ setLocation](https://www.php.net/manual/en/soapclient.setlocation.php)—设置要使用的Web服务的位置 - [SoapClient :: \_\_ setSoapHeaders](https://www.php.net/manual/en/soapclient.setsoapheaders.php)—为后续调用设置SOAP标头 - [SoapClient :: \_\_ soapCall](https://www.php.net/manual/en/soapclient.soapcall.php)—调用SOAP函数 - [SoapClient :: SoapClient](https://www.php.net/manual/en/soapclient.soapclient.php)— SoapClient构造函数 - [SoapServer](https://www.php.net/manual/en/class.soapserver.php)— SoapServer类 - [SoapServer :: addFunction](https://www.php.net/manual/en/soapserver.addfunction.php)—添加一个或多个函数来处理SOAP请求 - [SoapServer :: addSoapHeader](https://www.php.net/manual/en/soapserver.addsoapheader.php)—将SOAP标头添加到响应中 - [SoapServer :: \_\_ construct](https://www.php.net/manual/en/soapserver.construct.php)— SoapServer构造函数 - [SoapServer :: fault](https://www.php.net/manual/en/soapserver.fault.php)—发出SoapServer故障,指示错误 - [SoapServer :: getFunctions](https://www.php.net/manual/en/soapserver.getfunctions.php)—返回已定义函数的列表 - [SoapServer :: handle](https://www.php.net/manual/en/soapserver.handle.php)—处理SOAP请求 - [SoapServer :: setClass](https://www.php.net/manual/en/soapserver.setclass.php)—设置处理SOAP请求的类 - [SoapServer :: setObject](https://www.php.net/manual/en/soapserver.setobject.php)—设置将用于处理SOAP请求的对象 - [SoapServer :: setPersistence](https://www.php.net/manual/en/soapserver.setpersistence.php)—设置[SoapServer](https://www.php.net/manual/en/soapserver.setpersistence.php)持久模式 - [SoapServer :: SoapServer](https://www.php.net/manual/en/soapserver.soapserver.php)— SoapServer构造函数 - [SoapFault](https://www.php.net/manual/en/class.soapfault.php)— SoapFault类 - [SoapFault :: \_\_ construct](https://www.php.net/manual/en/soapfault.construct.php)— SoapFault构造函数 - [SoapFault :: SoapFault](https://www.php.net/manual/en/soapfault.soapfault.php)— SoapFault构造函数 - [SoapFault :: \_\_ toString](https://www.php.net/manual/en/soapfault.tostring.php)—获得SoapFault的字符串表示形式 - [SoapHeader](https://www.php.net/manual/en/class.soapheader.php)— SoapHeader类 - [SoapHeader :: \_\_ construct](https://www.php.net/manual/en/soapheader.construct.php)— SoapHeader构造函数 - [SoapHeader :: SoapHeader](https://www.php.net/manual/en/soapheader.soapheader.php)— SoapHeader构造函数 - [SoapParam](https://www.php.net/manual/en/class.soapparam.php)— SoapParam类 - [SoapParam :: \_\_ construct](https://www.php.net/manual/en/soapparam.construct.php)— SoapParam构造函数 - [SoapParam :: SoapParam](https://www.php.net/manual/en/soapparam.soapparam.php)— SoapParam构造函数 - [SoapVar](https://www.php.net/manual/en/class.soapvar.php)— SoapVar类 - [SoapVar :: \_\_ construct](https://www.php.net/manual/en/soapvar.construct.php)— SoapVar构造函数 - [SoapVar :: SoapVar](https://www.php.net/manual/en/soapvar.soapvar.php)— SoapVar构造函数