This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

ckWebServicePlugin and empty parameters

Ask help about existing plugins, or find advice about the way to build up your own.

ckWebServicePlugin and empty parameters

by RookFrank » Wed Jan 15, 2014 2:39 pm

Hello,

I work with symfony 1.4. and ckWebServicePlugin.

My service works perfectly

However I have problems with functionals tests.
My web service receives a request with empty parameters.

My service:
Code: Select all
   /**
    * MyService.
    *
    * @WSMethod(name='MyService', webservice='myAppSOAPI')
    * @WSHeader(name='AuthHeader', type='AuthData')
    *
         * @param string  $param1      parameter number 1
    *
    * @return ResultMyService
    */
   public function executeMyService($request) {

      $param1 = $request->getParameter('param1'   , '');
      
      $message ='$param1 = '.$param1 ;
      $this->result = new ResultMyService( '1', 'Test', $message);
        }


Code: Select all
  //ResultMonService  :
  public function __construct($id, $name, $message)
  {
    $this->id =  $id;
    $this->name     =  $name;
    $this->message    = $message;
  }


My functional test :
Code: Select all
<?php
$app   = 'myAPi';
$debug = true;
include_once(dirname(__FILE__).'/../../bootstrap/soaptest.php');

error_reporting(E_ALL);
ini_set('display_errors', '1');


$authData = new ClientAuthData('xxx', 'xxx');


$param1  = 'plop';

Doctrine_Core::loadData(sfConfig::get('sf_data_dir').'/fixtures/monservice');


$c = new ckTestSoapClient($options);
$c ->addRequestHeader('AuthHeaderElement', $authData)
    ->MyService($param1)
    ->isFaultEmpty(); 

$result = $c->getResult();
var_dump($result);



Test my service returns a fault because $param1 is empty.
$result var_dump:


Code: Select all
["message"]=>
  string(9) "$param1 ="


I don't understand why ...

I did this manipulation :
http://blog.adin.pro/2012-12-21/ckwebserviceplugin-empty-params/

But it doesn't work better.

I have an error message probably related to my problem :

Code: Select all
PHP Strict Standards:  Declaration of ckTestSoapClient::__doRequest() should be compatible with SoapClient::__doRequest($request, $location, $action, $version, $one_way = NULL) in /xxxxxxx/plugins/ckWebServicePlugin/lib/test/ckTestSoapClient.class.php on line 506


anybody can help me ?
RookFrank
Junior Member
 
Posts: 2
Joined: Wed Jan 15, 2014 2:35 pm