รบกวนสอบถาม เรื่อง web service ค่ะ จากตัวอย่าง php WebService Soap Client ที่โหลดมาจาก thaicreate ค่ะ
โค็คเดิม Code (PHP)
$client = new SoapClient("http://192.168.104.104/WebService/Service1.asmx?wsdl",
array(
"trace" => 1, // enable trace to view what is happening
"exceptions" => 0, // disable exceptions
"cache_wsdl" => 0) // disable any caching on the wsdl, encase you alter the wsdl server
);
$params = array(
'strName' => "Weerachai Nukitram"
);
$data = $client->HelloWorld($params);
print_r($data);
echo "<hr>";
echo $data->HelloWorldResult;
echo "<hr>";
// display what was sent to the server (the request)
echo "<p>Request :".htmlspecialchars($client->__getLastRequest()) ."</p>";
echo "<hr>";
// display the response from the server
echo "<p>Response:".htmlspecialchars($client->__getLastResponse())."</p>";
$client = new SoapClient("http://27.131.163.203/test8754/service.asmx/CallTHI?wsdl",
array(
"trace" => 1, // enable trace to view what is happening
"exceptions" => 0, // disable exceptions
"cache_wsdl" => 0) // disable any caching on the wsdl, encase you alter the wsdl server
);
$params = array(
"xxx" => "xxx",
"xxx" => "xxx"
);
$data = $client->CallTHI($params);
print_r($data);
echo "<hr>";
echo $data->CallTHIResult;
echo "<hr>";
// display what was sent to the server (the request)
echo "<p>Request :".htmlspecialchars($client->__getLastRequest()) ."</p>";
echo "<hr>";
// display the response from the server
echo "<p>Response:".htmlspecialchars($client->__getLastResponse())."</p>";