<?php

function httpRequestSoapData($responseUrl,$requestXML)
{
try{
$myhttp = new HttpRequest($responseUrl."?WSDL","POST");
//--相对于API2.0固定
$r_head=<<<BEGIN
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="​​​http://www.w3.org/2001/XMLSchema-instance​​​" xmlns:xsd="​​http://www.w3.org/2001/XMLSchema​​​" xmlns:soap="​​http://schemas.xmlsoap.org/soap/envelope/​​​">
<soap:Body>
<Request xmlns="​​​http://ctrip.com/​​​">
<requestXML>
BEGIN;

$r_end=<<<BEGIN
</requestXML>
</Request>
</soap:Body>
</soap:Envelope>
BEGIN; //返回头
$responseHead=<<<begin
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="​​​http://schemas.xmlsoap.org/soap/envelope/​​​" xmlns:xsi="​​http://www.w3.org/2001/XMLSchema-instance​​​" xmlns:xsd="​​http://www.w3.org/2001/XMLSchema"><soap:Body><RequestResponse​​​ xmlns="​​http://ctrip.com/"><RequestResult​​​>
begin;
//返回尾
$responseEnd=<<<begin
</RequestResult></RequestResponse></soap:Body></soap:Envelope>
begin; $requestXML=str_replace("<",@"<",$requestXML);
$requestXML=str_replace(">",@">",$requestXML); $requestXML=$r_head.$requestXML.$r_end;
$myhttp->open();
$myhttp->send($requestXML);
$myhttp->getResponseBody();
$coutw=$myhttp->getResponseBody();
$coutw=str_replace($responseHead,"",$coutw);//替换返回头
$coutw=str_replace($responseEnd,"",$coutw);//替换返回尾
$coutw=str_replace("<","<",$coutw);//将符号换回来
$coutw=str_replace(">",">",$coutw);//将符号换回来

// echo $coutw;
return $coutw;
}
catch (SoapFault $fault){
return $fault->faultcode;
}
}?>