使用 Post 方法调用
Call with Post Method
从我用 SOAP 调用 var_dump 得到结果如下:
WSDL 映射
stdClass 对象
(
[站点] => 数组
(
[0] => 标准类对象
(
[id] => 102728
[站点 ID] => 0
)
我想实现调用Sites数组显示数据:
Post 方法调用 SOAP 数据
<?php
$opts = array(
'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)
);`enter code here`
// SOAP 1.2 client
$params = array (
'encoding' => 'UTF-8',
'verifypeer' => false,
'verifyhost' => false,
'soap_version' => SOAP_1_2,
'trace' => 1, 'exceptions' => 1,
"connection_timeout" => 180,
'stream_context' => stream_context_create($opts) );
//disable wsdl cache
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient("http://www.example.com?WSDL",$params);
$result1=$client->getSiteInfo();
$zone = $result1->Sites;
if(isset($_POST['rayat'])){
echo $zone;
}
else {
?>
<form action="index.php" method="post">
<input id="rayat" name="rayat" size="10" type="text" value="" />
<input id="submit" name="submit" type="submit" value="submit" />
</form>
<div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre><code> <?php
//$param = array('isbn'=>'0385503954');
// define path to server application
$opts = array(
'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)
);
// SOAP 1.2 client
$params = array (
'encoding' => 'UTF-8',
'verifypeer' => false,
'verifyhost' => false,
'soap_version' => SOAP_1_2,
'trace' => 1, 'exceptions' => 1,
"connection_timeout" => 180,
'stream_context' => stream_context_create($opts) );
//disable wsdl cache
ini_set("soap.wsdl_cache_enabled", "0");
$server = '';
$client = new SoapClient("http://www.example.com?WSDL",$params);
$result1=$client->getSiteInfo();
$zone = $result1->Sites;
if(isset($_POST['rayat'])){
echo $zone;
}
else {
?>
<form action="champ.php" method="post">
<input id="rayat" name="rayat" size="10" type="text" value="" />
<input id="submit" name="submit" type="submit" value="submit" />
</form>
<?php
}
?>
从我用 SOAP 调用 var_dump 得到结果如下:
WSDL 映射
stdClass 对象 ( [站点] => 数组 ( [0] => 标准类对象 ( [id] => 102728 [站点 ID] => 0 )
我想实现调用Sites数组显示数据:
Post 方法调用 SOAP 数据
<?php
$opts = array(
'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)
);`enter code here`
// SOAP 1.2 client
$params = array (
'encoding' => 'UTF-8',
'verifypeer' => false,
'verifyhost' => false,
'soap_version' => SOAP_1_2,
'trace' => 1, 'exceptions' => 1,
"connection_timeout" => 180,
'stream_context' => stream_context_create($opts) );
//disable wsdl cache
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient("http://www.example.com?WSDL",$params);
$result1=$client->getSiteInfo();
$zone = $result1->Sites;
if(isset($_POST['rayat'])){
echo $zone;
}
else {
?>
<form action="index.php" method="post">
<input id="rayat" name="rayat" size="10" type="text" value="" />
<input id="submit" name="submit" type="submit" value="submit" />
</form>
<div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre><code> <?php
//$param = array('isbn'=>'0385503954');
// define path to server application
$opts = array(
'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)
);
// SOAP 1.2 client
$params = array (
'encoding' => 'UTF-8',
'verifypeer' => false,
'verifyhost' => false,
'soap_version' => SOAP_1_2,
'trace' => 1, 'exceptions' => 1,
"connection_timeout" => 180,
'stream_context' => stream_context_create($opts) );
//disable wsdl cache
ini_set("soap.wsdl_cache_enabled", "0");
$server = '';
$client = new SoapClient("http://www.example.com?WSDL",$params);
$result1=$client->getSiteInfo();
$zone = $result1->Sites;
if(isset($_POST['rayat'])){
echo $zone;
}
else {
?>
<form action="champ.php" method="post">
<input id="rayat" name="rayat" size="10" type="text" value="" />
<input id="submit" name="submit" type="submit" value="submit" />
</form>
<?php
}
?>