hermes1986 - 2013-09-12

i have some complex types here, we should call them nested complex type, it's because it is actually nested.. as shown below

    $server->wsdl->addComplexType(
        'RoomStays',
        'complexType',
        'struct',
        'all',
        '',
        array(
            'RoomStay' => array('name' => 'RoomStay', 'type' => 'tns:RoomStay')
               )
    );

    $server->wsdl->addComplexType(
        'RoomStay',
        'complexType',
        'struct',
        'all',
        '',
        array(
            'RoomTypes' => array('name' => 'RoomTypes', 'type' => 'tns:RoomTypes')
               )
    );

    $server->wsdl->addComplexType(
        'RoomTypes',
        'complexType',
        'struct',
        'all',
        '',
        array(
            'RoomType' => array('name' => 'RoomType', 'type' => 'tns:RoomType')
               )
    );

    $server->wsdl->addComplexType(
        'RoomType',
        'complexType',
        'struct',
        'all',
        '',
        array(
            'RoomTypeCode'=>array('name'=>'RoomTypeCode','type'=>'xsd:string'),
            'RoomDescription' => array('name' => 'RoomDescription', 'type' => 'tns:RoomDescription')
               )
    );

    $server->wsdl->addComplexType(
        'RoomDescription',
        'complexType',
        'struct',
        'all',
        '',
        array(
            'Name' => array('name' => 'Name', 'type' => 'xsd:string')
               )
    );

    $server->register('OTA_HotelAvailRQ',
                array('AvailRequestSegments'=>'tns:AvailRequestSegments'),
                array('RoomStays'=>'tns:RoomStays'),
                'http://localhost/myweb',
                'http://localhost/myweb#OTA_HotelAvailRQ',
                            'rpc',
                            'encoded',
                            'get avail hotel'
                                );

and i don't know how to insert values inside these nested complex types here, what i am trying to do is this :

    function OTA_HotelAvailRQ($param)
    {
               return array(
            'success'=>'success',
            'RoomTypeCode'=>'SGL',
            'Name'=>'single room'
        );

but it won't work.. i really need some help about this..
i really hope somebody would like to help me, thanks in advance...

 
Last edit: hermes1986 2013-09-12