当前位置:网站首页>[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
边栏推荐
- all3dp. All Arduino projects in com website (2022.7.1)
- Minimum value ruler method for the length of continuous subsequences whose sum is not less than s
- Usage record of vector
- Zzuli:1069 learn from classmate Z
- 7. Eleven state sets of TCP
- PHP 开发与测试 Webservice(SOAP)-Win
- ThreadLocal memory leak
- Fabric. JS upload local image to canvas background
- Reflection of the soul of the frame (important knowledge)
- mysql的约束总结
猜你喜欢

OLED12864 液晶屏

Centos8 installation mysql8.0.22 tutorial

Oled12864 LCD screen

ThreadLocal memory leak

《CGNF: CONDITIONAL GRAPH NEURAL FIELDS》阅读笔记

mysql的约束总结

Online music player app

2022-2-14 learning xiangniuke project - Section 7 account setting

JVM class loading mechanism

3D printer G code command: complete list and tutorial
随机推荐
Zzuli:1066 character classification statistics
Lingyunguang rushes to the scientific innovation board: the annual accounts receivable reaches 800million. Dachen and Xiaomi are shareholders
Uva548 tree
The Hong Kong Stock Exchange learned from US stocks and pushed spac: the follow-up of many PE companies could not hide the embarrassment of the world's worst stock market
3D printer G code command: complete list and tutorial
Zzuli:1067 faulty odometer
在线音乐播放器app
mysql的约束总结
软件测试答疑篇
15 C language advanced dynamic memory management
php获取cpu使用率、硬盘使用、内存使用
php数组转化为xml
【論文翻譯】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
Common protocols and download paths of NR
简单封装 js并应用
php读文件(读取json文件,转换为数组)
Generate QR code
php按照指定字符,获取字符串中的部分值,并重组剩余字符串为新的数组
Brew install * failed, solution
Fabric. JS iText sets the color and background color of the specified text