当前位置:网站首页>[whether PHP has soap extensions installed] a common problem for PHP to implement soap proxy: how to handle class' SoapClient 'not found in PHP
[whether PHP has soap extensions installed] a common problem for PHP to implement soap proxy: how to handle class' SoapClient 'not found in PHP
2022-07-02 05:49:00 【Jill__ er】
Browser view php Version of
phpstudy- Website - management - Open the root directory 
Turn on soap Expand
- see php Configuration information
- Write in the root directory test.php file , The contents are as follows :

- Open the browser to view the profile information : Address field input http://localhost/test.php, And find soap Information :

- Turn on soap Expand

- Look again php Configuration information , lookup soap Open successfully or not
- Open the browser to view the profile information : Address field input http://localhost/test.php, And find soap Information :

restart apache

Web Service example
Create in the root directory soap Folder , The file structure is as follows :
Client.php
<?php
try{
// non-wsdl Way to call web service
// establish SoapClient object
$soap = new SoapClient(null,array('location'=>"http://localhost/soap/Server.php",'uri'=>'Server.php'));
// Call function
$result1 = $soap->getName();
$result2 = $soap->__soapCall("getUrl",array());
echo $result1."<br/>";
echo $result2;
} catch(SoapFault $e){
echo $e->getMessage();
}catch(Exception $e){
echo $e->getMessage();
}
Server.php
<?php
// SiteInfo Class is used to process requests
Class SiteInfo
{
/**
* Return site name
* @return string
*
*/
public function getName(){
return " Novice tutorial -test";
}
public function getUrl(){
return "www.runoob.com";
}
}
// establish SoapServer object
$s = new SoapServer(null,array("location"=>"http://localhost/soap/Server.php","uri"=>"Server.php"));
// export SiteInfo All the functions in the class
$s->setClass("SiteInfo");
// Deal with one SOAP request , Call the necessary functions , And send back a response .
$s->handle();
?>
test webservice example
Open the browser and type :http://localhost/soap/Client.php
Reference link :https://blog.csdn.net/gayayang/article/details/6953367
边栏推荐
- Record sentry's path of stepping on the pit
- mysql事务和隔离级别
- Thread pool overview
- Visual Studio导入
- 460. LFU 缓存 双向链表
- Fabric. JS iText sets the color and background color of the specified text
- Pytorch Chinese document
- Visual studio import
- Get the details of the next largest number
- File contains vulnerabilities (II)
猜你喜欢

Fabric. JS centered element
![[technical notes-08]](/img/52/0aff21b01ba7adbfcdb597d1aa85f9.png)
[technical notes-08]

Lantern Festival gift - plant vs zombie game (realized by Matlab)

Innovation never stops -- the innovation process of nvisual network visualization platform for Excel import

【论文翻译】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond

软件测试答疑篇

正则表达式总结

Basic use of form

“简单”的无限魔方

Grbl software: basic knowledge of simple explanation
随机推荐
中小型项目手撸过滤器实现认证与授权
青训营--数据库实操项目
来啦~ 使用 EasyExcel 导出时进行数据转换系列新篇章!
php读文件(读取json文件,转换为数组)
Generate QR code
Reflection of the soul of the frame (important knowledge)
php数组转化为xml
mysql事务和隔离级别
all3dp. All Arduino projects in com website (2022.7.1)
Usage record of vector
Fabric. JS compact JSON
Sliding window on the learning road
Fabric. JS upload local image to canvas background
2022-2-14 learning xiangniuke project - Section 6 displays login information
Fabric. JS basic brush
kmp思想及模板代码
Zzuli:1062 greatest common divisor
php获取cpu使用率、硬盘使用、内存使用
生成二维码
vite如何兼容低版本浏览器