偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

CentOS SOAP擴展模塊觸發(fā)Service端執(zhí)行相應(yīng)的操作

系統(tǒng) Linux
首先,要確保安裝了CentOS SOAP擴展,沒有安裝的表現(xiàn)是,當(dāng)運行使用了soapclient的代碼時候會有php error Class ‘SoapClient’ not found的錯誤;這時候應(yīng)該安裝php-soap,在CentOS SOAP上可以方便的使用yum更新安裝包>yum install php-soap更新過這些安裝包后,需要重新啟動一下apache服務(wù).

CentOS SOAP對于電腦使用的玩家的常用軟件,然后我就學(xué)習(xí)及深入的研究CentOS SOAP,在這里和大家一起探討CentOS SOAP的使用方法,希望對大家有用。從PHP5開始內(nèi)置CentOS SOAP擴展模塊,通過它,我們可以方便的向Service發(fā)送一個CentOS SOAP消息,從而觸發(fā)Service端執(zhí)行相應(yīng)的操作,并將結(jié)果返回;

首先,要確保安裝了CentOS SOAP擴展,沒有安裝的表現(xiàn)是,當(dāng)運行使用了soapclient的代碼時候會有php error Class ‘SoapClient’ not found的錯誤;這時候應(yīng)該安裝php-soap,在CentOS SOAP上可以方便的使用yum更新安裝包>yum install php-soap更新過這些安裝包后,需要重新啟動一下apache服務(wù),此后SoapClient類就可以用在php script中了下邊是使用過程中的一個范例:

  1. <?php 
  2. $client = new SoapClient("some.wsdl");   
  3. $client->SomeFunction($a, $b, $c);  
  4. $arr= $client->__soapCall("SomeFunction", array($a, $b, $c));   
  5. print_r($arr);  
  6. ?>  

1.in WSDL mode,soapCall應(yīng)用web service,例子用的是asp.net的web service,提供service.asmx頁面,調(diào)用及查看都比較簡單,手冊上的example也大多是這個類型,比較簡單

CentOS SOAP發(fā)送的協(xié)議:

  1. POST /servicepath/service.asmx HTTP/1.1   
  2. Host: 211.186.1.4   
  3. Content-Type: text/xml; charset=utf-8   
  4. Content-Length: length   
  5. SOAPAction: "http://211.186.5.15/Service/ServiceMethod" 
  1. <?xml version="1.0" encoding="utf-8"?>   
  2. <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  3.  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  4. xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">   
  5. <soap:Body>   
  6. <ServiceMethod xmlns="http://211.186.5.15/Service">   
  7. <param1>string</param1>   
  8. <param2>string</param2>   
  9. <param3>string</param3>   
  10. </ServiceMethod>   
  11. </soap:Body>   
  12. </soap:Envelope> 

調(diào)用方法:

  1. $client = new SoapClient("http://www.xxx.com/service/service.asmx?WSDL");   
  2. //向SOAP服務(wù)方發(fā)送參數(shù)值   
  3. $param1 = "p1";   
  4. $param2 = "p2";   
  5. $param3 = "p3"

//serviceParam1,serviceParam2,serviceParam3為發(fā)送參數(shù)值所對應(yīng)的參數(shù)名(或service端提供的字段名) $param = array('serviceParam1' => $param1,'serviceParam2' => $param2,'serviceParam3' => $param3);

//方法名為ServiceMethod,參數(shù)數(shù)組為$param,默認以parameters字段標(biāo)示傳遞的參數(shù)數(shù)組 $arr = $client->__soapCall('ServiceMethod',array('parameters' => $param)); print_r($arr);

此處,print_r($arr)打印出來的是一個對象,類似于

  1. stdClass Object   
  2. ( [BindValidateResult] => 01062947546 ) 

經(jīng)過我多次的嘗試,發(fā)現(xiàn)使用$arr[1],$arr[0],$arr[BindValidateResult]均不能取得有效值;后來查詢到通過$arr->BindValidateResult可以訪問到返回值;

【編輯推薦】

  1. CentOS Nginx服務(wù)器配置nginx.conf
  2. CentOS VM主機支持RedHat AS3/AS4/AS5Linux操作系統(tǒng)
  3. CentOS yum倉庫使用 ISO 文件制作
  4. CentOS系統(tǒng)CPU過熱處理的解決方法
  5. CentOS bonding技術(shù)使用奇怪的拓撲結(jié)果
責(zé)任編輯:佚名 來源: CSDN
相關(guān)推薦

2010-02-03 15:46:43

Linux iso

2010-06-10 13:45:47

openSUSE軟件源

2009-12-23 17:49:28

WPF觸發(fā)器

2023-06-11 16:09:49

觸發(fā)器MySQL

2010-05-27 18:27:45

Linux測試工具

2010-03-02 09:59:03

Fedora Make

2010-09-10 15:04:40

SOAP HTTP

2011-03-11 12:57:30

CentosLAMP

2009-06-22 10:04:00

J2EE web se

2009-06-22 10:09:00

J2EE web se

2010-02-22 15:33:23

Python擴展模塊

2010-07-16 10:19:31

2021-01-26 00:37:12

物聯(lián)網(wǎng)安全物聯(lián)網(wǎng)端到端安全

2023-07-13 12:27:04

2010-07-14 17:29:36

SOAP協(xié)議

2009-05-25 17:40:54

Microsoft RService Con擴展

2009-10-16 09:42:06

2011-12-09 11:16:48

Node.js

2010-09-02 16:39:30

SOAP協(xié)議
點贊
收藏

51CTO技術(shù)棧公眾號