This XML file does not appear to have any style information associated with it. The document tree is shown below. <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="/api/soap/check" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="CheckService" targetNamespace="/api/soap/check"> <types> <xsd:schema targetNamespace="/api/soap/check"/> </types> <portType name="CheckServicePort"> <operation name="check"> <documentation>Check soap service, display name when called</documentation> <input message="tns:checkIn"/> <output message="tns:checkOut"/> </operation> </portType> <binding name="CheckServiceBinding" type="tns:CheckServicePort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="check"> <soap:operation soapAction="/api/soap/check#check"/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="/api/soap/check"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="/api/soap/check"/> </output> </operation> </binding> <service name="CheckServiceService"> <port name="CheckServicePort" binding="tns:CheckServiceBinding"> <soap:address location="/api/soap/check"/> </port> </service> <message name="checkIn"> <part name="name" type="xsd:string"/> </message> <message name="checkOut"> <part name="return" type="xsd:string"/> </message> </definitions>
<?php namespace Acme\ApiBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; use Zend\Soap; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\Request; //Template Dontrince Form Validation //dùng cho form class webserviceController extends Controller { public function wsAction() { try { $client = new \SoapClient('http://localhost:8000/api/soap/check?wsdl'); $a = array('name'=>'aa'); $response = $client->call('check', array('name' => 'Scott')); ladybug_dump($response->GetTrackingResult->Status); return new Response('<html><body>Hello '.$response .'!</body></html>'); } catch (\SoapFault $e) { var_dump($e->getMessage(), $client->__getLastResponse()); die(); } return array('response' => $response); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)