当前位置:网站首页>[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
边栏推荐
- Vite打包后的dist不能直接在浏览器打开吗
- Zzuli:1062 greatest common divisor
- 【技术随记-08】
- Fabric. JS upload local image to canvas background
- kmp思想及模板代码
- File contains vulnerability (I)
- Minimum value ruler method for the length of continuous subsequences whose sum is not less than s
- JVM class loading mechanism
- RGB 无限立方体(高级版)
- 1036 Boys vs Girls
猜你喜欢

Reading notes of cgnf: conditional graph neural fields

Fabric. JS compact JSON

5g market trend in 2020

Youth training camp -- database operation project

RGB 无限立方体(高级版)
![[PHP是否安装了 SOAP 扩]对于php实现soap代理的一个常见问题:Class ‘SoapClient‘ not found in PHP的处理方法](/img/25/73f11ab2711ed2cc9f20bc7f9116b6.png)
[PHP是否安装了 SOAP 扩]对于php实现soap代理的一个常见问题:Class ‘SoapClient‘ not found in PHP的处理方法

RGB infinite cube (advanced version)

文件包含漏洞(二)

Fabric. JS activation input box

Minimum value ruler method for the length of continuous subsequences whose sum is not less than s
随机推荐
Conglin environmental protection rushes to the scientific and Technological Innovation Board: it plans to raise 2billion yuan, with an annual profit of more than 200million yuan
Zzuli:1064 encrypted characters
【LeetCode】Day92-盛最多水的容器
Alibaba: open source and self-developed liquid cooling data center technology
Lingyunguang rushes to the scientific innovation board: the annual accounts receivable reaches 800million. Dachen and Xiaomi are shareholders
Get the details of the next largest number
Fabric. JS activation input box
1036 Boys vs Girls
Principle and implementation of parallax effect
XSS basic content learning (continuous update)
Fabric. JS iText superscript and subscript
Minimum value ruler method for the length of continuous subsequences whose sum is not less than s
Ubuntu 20.04 installing mysql8
OLED12864 液晶屏
[leetcode] day92 container with the most water
Huawei Hongmeng OS, is it OK?
[technical notes-08]
Fabric. JS 3 APIs to set canvas width and height
软件测试基础篇
文件包含漏洞(一)