Yii Framework Forum: Soap, Complex Type - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Soap, Complex Type Rate Topic: -----

#1 User is offline   test_yii 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 16-January 12

Posted 22 July 2013 - 12:24 PM

Mam taki problem, otóż chciałby przekazać do metody paramter który będzie tablicą wielowymiarową
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');

class SoapController extends CController {

  public function actions() {
    return array(
        'quote' => array(
            'class' => 'CWebServiceAction',
            'classMap' => array(
                'MojaTablica' => 'MojaTablica',
            ),
        ),
    );
  }

  /**
   * @parm MojaTablica[]
   * @return string
   * @soap
   */
  
    public function moja_metoda($tablica){
       ...
       if($tablica[0]->wartosc1 && $tablica[0]->wartosc2 && $tablica[0]->wartosc3){
          ...
       }
       ...
       retunr $arr;
    }
  

}

class MojaTablica {

  /**
   * @var string {nillable = 1, minOccurs=0}
   * @soap
   * */
  public $wartosc1;

  /**
   * @var string {nillable = 1, minOccurs=0}
   * @soap
   * */
  public $wartosc2;

  /**
   * @var string {nillable = 1, minOccurs=0}
   * @soap 
   * */
  public $wartosc3;

}


Taki kod niestety nie działa :/ Ma ktoś może jakiś pomysł?
0

#2 User is offline   aztech 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 206
  • Joined: 12-December 08
  • Location:Poland

Posted 23 July 2013 - 02:50 AM

Co konkretnie Ci nie działa?
Czy zwraca Ci jakiś błąd?
Gdzie wywołujesz i w jaki sposób funkcję moja_metoda?

View Posttest_yii, on 22 July 2013 - 12:24 PM, said:

Mam taki problem, otóż chciałby przekazać do metody paramter który będzie tablicą wielowymiarową
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');

class SoapController extends CController {

  public function actions() {
    return array(
        'quote' => array(
            'class' => 'CWebServiceAction',
            'classMap' => array(
                'MojaTablica' => 'MojaTablica',
            ),
        ),
    );
  }

  /**
   * @parm MojaTablica[]
   * @return string
   * @soap
   */
  
    public function moja_metoda($tablica){
   	...
   	if($tablica[0]->wartosc1 && $tablica[0]->wartosc2 && $tablica[0]->wartosc3){
          ...
   	}
   	...
   	retunr $arr;
    }
  

}

class MojaTablica {

  /**
   * @var string {nillable = 1, minOccurs=0}
   * @soap
   * */
  public $wartosc1;

  /**
   * @var string {nillable = 1, minOccurs=0}
   * @soap
   * */
  public $wartosc2;

  /**
   * @var string {nillable = 1, minOccurs=0}
   * @soap 
   * */
  public $wartosc3;

}


Taki kod niestety nie działa :/ Ma ktoś może jakiś pomysł?

I'm not complete idiot... some parts are missing!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users