\ //---> service.php require 'products.class.php'; function getAllCategory($conditionCate){ $product = new Products(); $acate = $product->show_category('*',$conditionCate=null); return $acate; // array() } //---> service.wsdl <?xml version ='1.0' encoding ='UTF-8' ?> <definitions name='StockQuote' targetNamespace='http://example.org/StockQuote' xmlns:tns=' http://example.org/StockQuote ' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns='http://schemas.xmlsoap.org/wsdl/'> <message name='allCategoryReques'> <part name='conditionCate' type='xsd:string'/> </message> <message name='allCategoryResponse'> <part name='ResultAllCate' type="xsd:string"/> </message> <portType name='productsPortType'> <operation name='getAllCategory'> <input message='tns:allCategoryReques'/> <output message='tns:allCategoryResponse'/> </operation> </portType> <binding name='productsBinding' type='tns:productsPortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='getAllCategory'> <soap:operation soapAction='urn:xmethods-delayed-quotes#getAllCategory'/> <input> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </input> <output> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </output> </operation> </binding> <service name='priceService'> <port name='productsPort' binding='productsBinding'> <soap:address location='http://127.0.0.1/k-station/includes/price/service.php'/> </port> </service> </definitions> //---> test_conn.php $soap_client = new SoapClient( "http://127.0.0.1/k-station/includes/price/service.wsdl",array("trace" => 1, "exceptions" => 0)); // ,array("trace" => 1, "exceptions" => 0) $test = $soap_client->getAllCategory('5'); var_dump($soap_client->__getFunctions()); echo '<br/>--------------------------<br/>'; print "Request : ".htmlspecialchars($soap_client->__getLastRequest()) ; echo '<br/>--------------------------<br/>'; print "Response : ".htmlspecialchars($soap_client->__getLastResponse()); /* foreach ($test as $a) { print_r($a); echo $i++; } */ //---> ผลลัพธ์จาการรัน array(1) { [0]=> string(44) "string getAllCategory(string $conditionCate)" } -------------------------- Request : <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethods-delayed-quotes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:getAllCategory><conditionCate xsi:type="xsd:string">5</conditionCate></ns1:getAllCategory></SOAP-ENV:Body></SOAP-ENV:Envelope> -------------------------- Response :
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง