Click here to Skip to main content
15,559,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
I create webservice in symfony
and it generation a wsdl look like that
HTML
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>

and i create a client
PHP
<?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);
     
   
    }

}

but i not run please help me

What I have tried:

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

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