当前位置:网站首页>[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
边栏推荐
- 文件包含漏洞(二)
- 死磕大屏UI,FineReport开发日记
- [PHP是否安装了 SOAP 扩]对于php实现soap代理的一个常见问题:Class ‘SoapClient‘ not found in PHP的处理方法
- 1036 Boys vs Girls
- 2022-2-15 learning xiangniuke project - Section 8 check login status
- vite如何兼容低版本浏览器
- Fabric. JS gradient
- Zzuli:1066 character classification statistics
- Technologists talk about open source: This is not just using love to generate electricity
- RNN recurrent neural network
猜你喜欢
JVM class loading mechanism
[golang syntax] be careful with the copy of slices
3D printer G code command: complete list and tutorial
2022-2-15 learning xiangniuke project - Section 8 check login status
mysql事务和隔离级别
Visual Studio導入
Fabric. JS gradient
Disable access to external entities in XML parsing
Technologists talk about open source: This is not just using love to generate electricity
Grbl software: basic knowledge of simple explanation
随机推荐
【论文翻译】GCNet: Non-local Networks Meet Squeeze-Excitation Networks and Beyond
php读文件(读取文件内含有某字符串的指定行)
Lingyunguang rushes to the scientific innovation board: the annual accounts receivable reaches 800million. Dachen and Xiaomi are shareholders
460. LFU 缓存 双向链表
Php/js cookie sharing across domains
Straighten elements (with transition animation)
ThreadLocal memory leak
RGB 无限立方体(高级版)
简单封装 js并应用
Zzuli:1060 numbers in reverse order
php内的addChild()、addAttribute()函数
Zzuli:1068 binary number
JVM class loading mechanism
中小型项目手撸过滤器实现认证与授权
Cambrian was reduced by Paleozoic venture capital and Zhike shengxun: a total of more than 700million cash
How to write good code - Defensive Programming Guide
[technical notes-08]
记录sentry的踩坑之路
线程池概述
php内类名称与类内方法名相同