the problem is partially solved now. i think nuSOAP is very helpful, i write PHP code shown below, and the 'SOAP request' problem is partially solved.
<?php
require_once('lib/nusoap.php');
$server = new nusoap_server;
$server->configureWSDL('server','http://localhost/myweb');
$server->wsdl->schemaTargetNamespace = 'http://localhost/myweb';
$server->wsdl->addComplexType(
'AvailRequestSegments',
'complexType',
'struct',
'all',
'',
array(
'AvailRequestSegment' => array('name' => 'AvailRequestSegment', 'type' => 'tns:AvailRequestSegment')
)
);
$server->wsdl->addComplexType(
'AvailRequestSegment',
'complexType',
'struct',
'all',
'',
array(
'AvailReqType'=>array('name'=>'AvailReqType','type'=>'xsd:string','value'=>'Room'),
'HotelSearchCriteria' => array('name' => 'HotelSearchCriteria', 'type' => 'tns:HotelSearchCriteria')
)
);
$server->wsdl->addComplexType(
'HotelSearchCriteria',
'complexType',
'struct',
'all',
'',
array(
'Criterion' => array('name' => 'Criterion', 'type' => 'tns:Criterion')
)
);
$server->wsdl->addComplexType(
'Criterion',
'complexType',
'struct',
'all',
'',
array(
'HotelRef' => array('name' => 'HotelRef', 'type' => 'tns:HotelRef')
)
);
$server->wsdl->addComplexType(
'HotelRef',
'complexType',
'struct',
'all',
'',
array(
'HotelCode' => array('name' => 'HotelCode', 'type' => 'xsd:string')
)
);
/*---------------------------segment response---------------------------------------------*/
$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#SayHello');
function OTA_HotelAvailRQ($param)
{
return array(
'success'=>'success',
'RoomTypeCode'=>'SGL',
'Name'=>'single room'
);
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
and the rest of my problem is, how to insert 'some data' into complex types i created, i have try this
return array(
'success'=>'success',
'RoomTypeCode'=>'SGL',
'Name'=>'single room'
);
but it won't work, and the SOAP response is :
<SOAP-ENV Envelope SOAP-ENV:encoding xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://localhost/myweb">
<SOAP-ENV:Body>
<ns1:OTA_HotelAvailRQResponse xmlns:ns1="http://localhost/myweb">
<RoomStays xsi:type="tns:RoomStays"/>
</ns1:OTA_HotelAvailRQResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
and finally the last thing i have to solve is, i don't know how to put AvailReqType="Room" attribute inside the < AvailRequestSegment> as shown below
<AvailRequestSegment AvailReqType="Room">
it's very appreciate if somebody would like to help me... thanks in advance..