当前位置:网站首页>PHP development and testing WebService (soap) -win
PHP development and testing WebService (soap) -win
2022-07-02 05:49:00 【Jill__ er】
WebService Is a cross programming language and cross operating system platform remote call technology .
> Environment building
1.phpStudy link :https://pan.baidu.com/s/1Uk5Cq28tSXBkolgmSarYnw?pwd=x2b8
2.phpStudy Extraction code :x2b8
> understand webservice
1. On the face of it ,WebService It's an application that exposes itself to the outside world through Web Calling API, In other words, it can be programmed through Web To call this application . We call this WebService Is called the client , And to provide this WebService Is called the server side .
2. At a deeper level ,WebService Is a new platform for building interoperable distributed applications , It's a platform , It's a set of standards . It defines how an application works in Web Interoperability on the Internet , You can use any language you like , Write on any platform you like Web service , As long as we can get through Web service Standards query and access these services .
3.Web Service It's a platform independent , Low coupling , Self contained 、 Based on programmable web Applications for , Open... Can be used XML( A subset of the standard generic markup language ) Standard to describe 、 Release 、 Find out 、 Coordinate and configure these applications , Applications for developing distributed, interoperable applications . [1]
4.Web Service technology , It can make different applications run on different machines without the aid of additional 、 Specialized third-party software or hardware , You can exchange data or integrate with each other . basis Web Service Between the application of specification implementation , Whatever language they use 、 What is the platform or internal protocol , Can exchange data with each other .Web Service It's self describing 、 Self contained available network modules , Can perform specific business functions .Web Service It's also easy to deploy , Because they are based on some conventional industry standards and some existing technologies , Such as a subset of the standard General Markup Language XML、HTTP.Web Service Reduce the cost of application interface .Web Service It provides a common mechanism for the integration of business processes among the whole enterprise or even multiple organizations .
> Web The three cores of service
1、Soap:
SOAP(Simple Object Access Protocol, Simple object access protocol ) It's based on xml The agreement , Used in step-by-step applications can recognize . in addition ,SOAP There is no programming language defined by itself , This makes SOAP It can be delivered to various remote systems in the form of messages .SOAP The transmission protocol used , It can be HTTP,SMTP,POP3,JMS.
SOAP It includes 4 part :
01.“SOAP encapsulation (Envelope)”:
Define what a description information describes , Who sent it , Who should deal with him , And how to deal with their framework .02.“SOAP Encoding rules ”:
An instance that represents the data type that the application needs to use .03.“SOAP RPC":
Represents a protocol for calling and answering in a remote procedure .04.“SOPA binding ”:
Exchange information using underlying protocols .2.WSDL:
WSDL(Web Service Description Language,web Service description language ) It's a XML file , He defines a given in an abstract way independent of the concrete language web Relevant operations and messages of service recipients .3.UDDI:
UDDI(Universal Description Discovery and Integration, Unified description of discovery and integration protocols ) It's a norm , Defines and web Release of service related information , Discover and manage .
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
Refer to the connection :
http://47.106.68.247/ycsyth/webservices/ycsbizService?wsdl
https://blog.csdn.net/qq_33196814/article/details/122303882
https://www.cnblogs.com/guanfuchang/p/5985070.html
边栏推荐
- Résumé de la collection de plug - ins couramment utilisée dans les outils de développement idea
- H5 jump applet
- Visual Studio导入
- Php/js cookie sharing across domains
- h5跳小程序
- Common protocols and download paths of NR
- Yyds dry inventory what is test driven development
- 2022-2-15 learning xiangniuke project - Section 8 check login status
- Importation de studio visuel
- php按照指定字符,获取字符串中的部分值,并重组剩余字符串为新的数组
猜你喜欢
"Original, excellent and vulgar" in operation and maintenance work
Fabric. JS iText sets the color and background color of the specified text
Lantern Festival gift - plant vs zombie game (realized by Matlab)
[personal test] copy and paste code between VirtualBox virtual machine and local
Fabric. JS right click menu
Installation du tutoriel MySQL 8.0.22 par centos8
Practice C language advanced address book design
Technologists talk about open source: This is not just using love to generate electricity
Principle and implementation of parallax effect
RGB 无限立方体(高级版)
随机推荐
Visual studio import
A collection of commonly used plug-ins for idea development tools
MySQL foundation --- query (learn MySQL foundation in 1 day)
RGB infinite cube (advanced version)
460. LFU 缓存 双向链表
Zzuli:1062 greatest common divisor
Win10 copy files, save files... All need administrator permission, solution
Zzuli:1066 character classification statistics
Php/js cookie sharing across domains
How to write good code - Defensive Programming Guide
Innovation never stops -- the innovation process of nvisual network visualization platform for Excel import
Fabric. JS gradient
Record sentry's path of stepping on the pit
VSCode paste image插件保存图片路径设置
Common protocols and download paths of NR
Usage record of vector
brew install * 失败,解决方法
Go language web development is very simple: use templates to separate views from logic
如何写出好代码 — 防御式编程指南
[Chongqing Guangdong education] selected reading reference materials of British and American literature of Nanyang Normal University