บันทึกไว้ก่อน ไว้มีเวลาจะทดสอบดู
php5 wsdl writer เป็น wsdl library ดูแล้วใช้ง่ายดี
<?php
require_once("wsdl/classes/WsdlDefinition.php");
require_once("wsdl/classes/WsdlWriter.php");
// Get the Server Infomation for Constructing the WSDL
$requestUri = $_SERVER["REQUEST_URI"];
$serverAddr = $_SERVER["SERVER_ADDR"];
// String which is the Name of Your Class
$serviceName = $_GET["wsdl"];
// Create an End Point URL
$endPoint = preg_replace("/\?wsdl=/", "?service=", $requestUri);
// Create a WSDL Definition Object
$def = new WsdlDefinition();
$def->setDefinitionName($serviceName);
$def->setClassFileName("{$serviceName}.php");
$def->setWsdlFileName("{$serviceName}.wsdl");
$def->setNameSpace("http://{$serverAddr}{$requestUri}");
$def->setEndPoint("http://{$serverAddr}{$endPoint}");
// Create the WSDL Writer Object
$wsdl = new WsdlWriter($def);
// print the WSDL
print $wsdl->classToWsdl();
?>
สนใจ download ได้ที่ http://www.giffin.org/wsdlwriter.php
WSDLตัวนี้ คืออะไรอ่ะครับ ไม่ รู้อ่ะ บอกหน่อยได้ไหมครับผม
Web Services Description Language เป็นเอกสารที่จะอธิบาย บริการต่างๆ(web methods) และรูปแบบของการรับ และส่งข้อมูลระหว่างผู้ให้บริการ และผู้ใช้บริการ
Links
http://truehits.net/faq/webmaster/webservice/
http://www.w3.org/TR/wsdl
http://en.wikipedia.org/wiki/Web_Services_Description_Language