Click here to Skip to main content
15,607,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I create webservice in symfony
and it generation a wsdl look like that
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<definitions xmlns="" xmlns:wsdl="" xmlns:tns="/api/soap/check" xmlns:soap="" xmlns:xsd="" xmlns:soap-enc="" xmlns:soap12="" name="CheckService" targetNamespace="/api/soap/check">
<xsd:schema targetNamespace="/api/soap/check"/>
<portType name="CheckServicePort">
<operation name="check">
<documentation>Check soap service, display name when called</documentation>
<input message="tns:checkIn"/>
<output message="tns:checkOut"/>
<binding name="CheckServiceBinding" type="tns:CheckServicePort">
<soap:binding style="rpc" transport=""/>
<operation name="check">
<soap:operation soapAction="/api/soap/check#check"/>
<soap:body use="encoded" encodingStyle="" namespace="/api/soap/check"/>
<soap:body use="encoded" encodingStyle="" namespace="/api/soap/check"/>
<service name="CheckServiceService">
<port name="CheckServicePort" binding="tns:CheckServiceBinding">
<soap:address location="/api/soap/check"/>
<message name="checkIn">
<part name="name" type="xsd:string"/>
<message name="checkOut">
<part name="return" type="xsd:string"/>

and i create a client

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'));
               return new Response('<html><body>Hello '.$response .'!</body></html>');
        } catch (\SoapFault $e) {
            var_dump($e->getMessage(), $client->__getLastResponse()); die();
    return array('response' => $response);


but i not run please help me

What I have tried:

i try to create webclient but it not run plaes help me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900