Question

I have a simple webservice in symfony2 that is working perfectly. I have added a new method, however, strangely, that method is not recognized, even when I see it in the WSDL definition.

Please load: WSDL definition

Method is called GetHoliday

The controller that executes that method is the following:

public function getHolidayAction() {
    date_default_timezone_set('America/Santiago');

    $request = $this->getRequest();

    $client = new \SoapClient('http://' . $request->getHttpHost() . $request->getScriptName() . '/feriados?wsdl');

    $year = $request->get('year');
    $month = $request->get('month');
    $day = $request->get('day');

    $types = $client->__getFunctions();

    var_dump($types);
    die();

    $result = $client->GetHoliday('8cd4c502f69b5606a8bef291deaac1ba83bb7727', 'cl', $year, $month, $day);
    echo $result;
    die();
}

After the call to __getFunctions call, GetHoliday method is missing.

If you want to see the __getFunctions response, please load online site

Enter any date in the input field. The response will appear in red.

The most curious thing, is that this works in my development machine which also has RedHat operating system (my hosting is HostGator).

Any help will be appreciated,

Was it helpful?

Solution

Finally, the problem was that the WSDL was being cached.

To make the first test, I used

  $client = new \SoapClient('http://' . $request->getHttpHost() . $request->getScriptName() . '/feriados?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE) ); 

To instantiate SoapClient. That way, it worked. so to get rid of WSDL_CACHE_NONE parameter, I deleted all files that start with wsdl in /tmp folder.

Regards, Jaime

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top