Я попытался получить ответ от запроса SOAP с использованием CURL, но не смог добиться успеха. У меня возникла ошибка,
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Я использовал код,
$envelope = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://schemas.tourico.com/webservices/authentication" xmlns:hot="http://tourico.com/webservices/hotelv3" xmlns:hot1="http://schemas.tourico.com/webservices/hotelv3"> <soapenv:Header> <aut:AuthenticationHeader> <aut:LoginName>vibXXX</aut:LoginName> <aut:Password>111111</aut:Password> <!--Optional:--> <aut:Culture>en_US</aut:Culture> <!--Optional:--> <aut:Version>7.123</aut:Version> </aut:AuthenticationHeader> </soapenv:Header> <soapenv:Body> <hot:SearchHotels> <!--Optional:--> <hot:request> <!--Optional:--> <hot1:Destination>NYC</hot1:Destination> <!--Optional:--> <hot1:HotelCityName>New York</hot1:HotelCityName> <!--Optional:--> <hot1:HotelLocationName></hot1:HotelLocationName> <!--Optional:--> <hot1:HotelName></hot1:HotelName> <hot1:CheckIn>2014-02-15</hot1:CheckIn> <hot1:CheckOut>2014-02-18</hot1:CheckOut> <!--Optional:--> <hot1:RoomsInformation> <!--Zero or more repetitions:--> <hot1:RoomInfo> <hot1:AdultNum>2</hot1:AdultNum> <hot1:ChildNum>0</hot1:ChildNum> <!--Optional:--> <hot1:ChildAges> <!--Zero or more repetitions:--> <hot1:ChildAge age="0"/> </hot1:ChildAges> </hot1:RoomInfo> </hot1:RoomsInformation> <hot1:MaxPrice>0</hot1:MaxPrice> <hot1:StarLevel>0</hot1:StarLevel> <hot1:AvailableOnly>1</hot1:AvailableOnly> <hot1:PropertyType>NotSet</hot1:PropertyType> <hot1:ExactDestination>1</hot1:ExactDestination> </hot:request> </hot:SearchHotels> </soapenv:Body> </soapenv:Envelope>'; $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, "http://demo-hotelws.touricoholidays.com/hotelflow.svc?wsdl" ); curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($soap_do, CURLOPT_TIMEOUT, 10); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $envelope); curl_setopt($soap_do, CURLOPT_VERBOSE, TRUE); curl_setopt($soap_do, CURLOPT_HTTPHEADER, array("Content-Type: text/xml","SOAPAction: \"http://demo-hotelws.touricoholidays.com/HotelFlow.svc/bas\"", "Content-length: ".strlen($envelope))); $result = curl_exec($soap_do); echo "<pre>"; print_r($result); exit;
-$envelope = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://schemas.tourico.com/webservices/authentication" xmlns:hot="http://tourico.com/webservices/hotelv3" xmlns:hot1="http://schemas.tourico.com/webservices/hotelv3"> <soapenv:Header> <aut:AuthenticationHeader> <aut:LoginName>vibXXX</aut:LoginName> <aut:Password>111111</aut:Password> <!--Optional:--> <aut:Culture>en_US</aut:Culture> <!--Optional:--> <aut:Version>7.123</aut:Version> </aut:AuthenticationHeader> </soapenv:Header> <soapenv:Body> <hot:SearchHotels> <!--Optional:--> <hot:request> <!--Optional:--> <hot1:Destination>NYC</hot1:Destination> <!--Optional:--> <hot1:HotelCityName>New York</hot1:HotelCityName> <!--Optional:--> <hot1:HotelLocationName></hot1:HotelLocationName> <!--Optional:--> <hot1:HotelName></hot1:HotelName> <hot1:CheckIn>2014-02-15</hot1:CheckIn> <hot1:CheckOut>2014-02-18</hot1:CheckOut> <!--Optional:--> <hot1:RoomsInformation> <!--Zero or more repetitions:--> <hot1:RoomInfo> <hot1:AdultNum>2</hot1:AdultNum> <hot1:ChildNum>0</hot1:ChildNum> <!--Optional:--> <hot1:ChildAges> <!--Zero or more repetitions:--> <hot1:ChildAge age="0"/> </hot1:ChildAges> </hot1:RoomInfo> </hot1:RoomsInformation> <hot1:MaxPrice>0</hot1:MaxPrice> <hot1:StarLevel>0</hot1:StarLevel> <hot1:AvailableOnly>1</hot1:AvailableOnly> <hot1:PropertyType>NotSet</hot1:PropertyType> <hot1:ExactDestination>1</hot1:ExactDestination> </hot:request> </hot:SearchHotels> </soapenv:Body> </soapenv:Envelope>'; $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, "http://demo-hotelws.touricoholidays.com/hotelflow.svc?wsdl" ); curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($soap_do, CURLOPT_TIMEOUT, 10); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $envelope); curl_setopt($soap_do, CURLOPT_VERBOSE, TRUE); curl_setopt($soap_do, CURLOPT_HTTPHEADER, array("Content-Type: text/xml","SOAPAction: \"http://demo-hotelws.touricoholidays.com/HotelFlow.svc/bas\"", "Content-length: ".strlen($envelope))); $result = curl_exec($soap_do); echo "<pre>"; print_r($result); exit;
Название$envelope = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://schemas.tourico.com/webservices/authentication" xmlns:hot="http://tourico.com/webservices/hotelv3" xmlns:hot1="http://schemas.tourico.com/webservices/hotelv3"> <soapenv:Header> <aut:AuthenticationHeader> <aut:LoginName>vibXXX</aut:LoginName> <aut:Password>111111</aut:Password> <!--Optional:--> <aut:Culture>en_US</aut:Culture> <!--Optional:--> <aut:Version>7.123</aut:Version> </aut:AuthenticationHeader> </soapenv:Header> <soapenv:Body> <hot:SearchHotels> <!--Optional:--> <hot:request> <!--Optional:--> <hot1:Destination>NYC</hot1:Destination> <!--Optional:--> <hot1:HotelCityName>New York</hot1:HotelCityName> <!--Optional:--> <hot1:HotelLocationName></hot1:HotelLocationName> <!--Optional:--> <hot1:HotelName></hot1:HotelName> <hot1:CheckIn>2014-02-15</hot1:CheckIn> <hot1:CheckOut>2014-02-18</hot1:CheckOut> <!--Optional:--> <hot1:RoomsInformation> <!--Zero or more repetitions:--> <hot1:RoomInfo> <hot1:AdultNum>2</hot1:AdultNum> <hot1:ChildNum>0</hot1:ChildNum> <!--Optional:--> <hot1:ChildAges> <!--Zero or more repetitions:--> <hot1:ChildAge age="0"/> </hot1:ChildAges> </hot1:RoomInfo> </hot1:RoomsInformation> <hot1:MaxPrice>0</hot1:MaxPrice> <hot1:StarLevel>0</hot1:StarLevel> <hot1:AvailableOnly>1</hot1:AvailableOnly> <hot1:PropertyType>NotSet</hot1:PropertyType> <hot1:ExactDestination>1</hot1:ExactDestination> </hot:request> </hot:SearchHotels> </soapenv:Body> </soapenv:Envelope>'; $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, "http://demo-hotelws.touricoholidays.com/hotelflow.svc?wsdl" ); curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($soap_do, CURLOPT_TIMEOUT, 10); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $envelope); curl_setopt($soap_do, CURLOPT_VERBOSE, TRUE); curl_setopt($soap_do, CURLOPT_HTTPHEADER, array("Content-Type: text/xml","SOAPAction: \"http://demo-hotelws.touricoholidays.com/HotelFlow.svc/bas\"", "Content-length: ".strlen($envelope))); $result = curl_exec($soap_do); echo "<pre>"; print_r($result); exit;
Название$envelope = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://schemas.tourico.com/webservices/authentication" xmlns:hot="http://tourico.com/webservices/hotelv3" xmlns:hot1="http://schemas.tourico.com/webservices/hotelv3"> <soapenv:Header> <aut:AuthenticationHeader> <aut:LoginName>vibXXX</aut:LoginName> <aut:Password>111111</aut:Password> <!--Optional:--> <aut:Culture>en_US</aut:Culture> <!--Optional:--> <aut:Version>7.123</aut:Version> </aut:AuthenticationHeader> </soapenv:Header> <soapenv:Body> <hot:SearchHotels> <!--Optional:--> <hot:request> <!--Optional:--> <hot1:Destination>NYC</hot1:Destination> <!--Optional:--> <hot1:HotelCityName>New York</hot1:HotelCityName> <!--Optional:--> <hot1:HotelLocationName></hot1:HotelLocationName> <!--Optional:--> <hot1:HotelName></hot1:HotelName> <hot1:CheckIn>2014-02-15</hot1:CheckIn> <hot1:CheckOut>2014-02-18</hot1:CheckOut> <!--Optional:--> <hot1:RoomsInformation> <!--Zero or more repetitions:--> <hot1:RoomInfo> <hot1:AdultNum>2</hot1:AdultNum> <hot1:ChildNum>0</hot1:ChildNum> <!--Optional:--> <hot1:ChildAges> <!--Zero or more repetitions:--> <hot1:ChildAge age="0"/> </hot1:ChildAges> </hot1:RoomInfo> </hot1:RoomsInformation> <hot1:MaxPrice>0</hot1:MaxPrice> <hot1:StarLevel>0</hot1:StarLevel> <hot1:AvailableOnly>1</hot1:AvailableOnly> <hot1:PropertyType>NotSet</hot1:PropertyType> <hot1:ExactDestination>1</hot1:ExactDestination> </hot:request> </hot:SearchHotels> </soapenv:Body> </soapenv:Envelope>'; $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, "http://demo-hotelws.touricoholidays.com/hotelflow.svc?wsdl" ); curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($soap_do, CURLOPT_TIMEOUT, 10); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $envelope); curl_setopt($soap_do, CURLOPT_VERBOSE, TRUE); curl_setopt($soap_do, CURLOPT_HTTPHEADER, array("Content-Type: text/xml","SOAPAction: \"http://demo-hotelws.touricoholidays.com/HotelFlow.svc/bas\"", "Content-length: ".strlen($envelope))); $result = curl_exec($soap_do); echo "<pre>"; print_r($result); exit;
Я получил ответ в программном обеспечении SOAPUI, но не работал с php-кодом.
Может ли кто-нибудь помочь мне разобраться с этой проблемой?
Я также пробовал с клиентом SOAP. Он также не работает. Я ранее задавал вопрос https://stackoverflow.com/questions/21521785/soap-request-for-tourico-webservice-implementation