Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用postman和php发送soap 4.0标头_Php_Soap_Postman_Soapheader_Amadeus - Fatal编程技术网

如何使用postman和php发送soap 4.0标头

如何使用postman和php发送soap 4.0标头,php,soap,postman,soapheader,amadeus,Php,Soap,Postman,Soapheader,Amadeus,我想使用Amadeus API进行搜索飞行。 我购买了企业帐户。 他们向我提供了证件。 但也许我的请求没有到达他们的终点。 我正试着通过邮递员。 但当我们在浏览器上打开时,会返回相同的响应。 i、 e.我的请求参数未命中URL: 这是我的密码 $soapUrl = "https://noded2.test.webservices.amadeus.com/".$wsap; /* $xml_post_string = '<?xml version="1.0" encoding="utf-8

我想使用Amadeus API进行搜索飞行。 我购买了企业帐户。 他们向我提供了证件。 但也许我的请求没有到达他们的终点。 我正试着通过邮递员。 但当我们在浏览器上打开时,会返回相同的响应。 i、 e.我的请求参数未命中URL:

这是我的密码


$soapUrl = "https://noded2.test.webservices.amadeus.com/".$wsap;
/*
$xml_post_string = '<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><SearchCollectionPoint xmlns="http://privpakservices.schenker.nu/"><customerID>XXX</customerID><key>XXXXXX-XXXXXX</key><serviceID></serviceID><paramID>0</paramID><address>RiksvŠgen 5</address><postcode>59018</postcode><city>Mantorp</city><maxhits>10</maxhits></SearchCollectionPoint></soap12:Body></soap12:Envelope>';
*/
$xml_post_string  = '';
$xml_post_string .= '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ses="http://xml.amadeus.com/2010/06/Session_v3">';
$xml_post_string .= '<soap:Header>';
// $xml_post_string .= '<add:MessageID xmlns:add="http://www.w3.org/2005/08/addressing">2fc42c4e-d34f-414e-b064-d37acd6bdc9c</add:MessageID>';
$xml_post_string .= '<add:MessageID xmlns:add="http://www.w3.org/2005/08/addressing">'.$MessageID.'</add:MessageID>';
$xml_post_string .= '<add:Action xmlns:add="http://www.w3.org/2005/08/addressing">http://webservices.amadeus.com/FMPTBQ_18_1_1A</add:Action>';
$xml_post_string .= '<add:To xmlns:add="http://www.w3.org/2005/08/addressing">https://noded2.test.webservices.amadeus.com/'.$wsap.'</add:To>';
$xml_post_string .= '<link:TransactionFlowLink xmlns:link="http://wsdl.amadeus.com/2010/06/ws/Link_v1" />';
$xml_post_string .= '<oas:Security xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:oas1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">';
$xml_post_string .= '<oas:UsernameToken oas1:Id="UsernameToken-1">';
$xml_post_string .= '<oas:Username>'.$wbs_user_id.'</oas:Username>';
$xml_post_string .= '<oas:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'.$nonce.'</oas:Nonce>';
$xml_post_string .= '<oas:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">'.$passworddigest.'</oas:Password>';
$xml_post_string .= '<oas1:Created>'.$created.'</oas1:Created>';
$xml_post_string .= '</oas:UsernameToken>';
$xml_post_string .= '</oas:Security>';
$xml_post_string .= '<AMA_SecurityHostedUser xmlns="http://xml.amadeus.com/2010/06/Security_v1">';
$xml_post_string .= '<UserID AgentDutyCode="SU" POS_Type="1" PseudoCityCode="'.$office_id.'" RequestorType="U" />';
$xml_post_string .= '</AMA_SecurityHostedUser>';
$xml_post_string .= '</soap:Header>';
$xml_post_string .= '<soap:Body>';
$xml_post_string .= '<Fare_MasterPricerTravelBoardSearch>';
$xml_post_string .= '<numberOfUnit>';
$xml_post_string .= '<unitNumberDetail>';
$xml_post_string .= '<numberOfUnits>30</numberOfUnits>';
$xml_post_string .= '<typeOfUnit>RC</typeOfUnit>';
$xml_post_string .= '</unitNumberDetail>';
$xml_post_string .= '<unitNumberDetail>';
$xml_post_string .= '<numberOfUnits>1</numberOfUnits>';
$xml_post_string .= '<typeOfUnit>PX</typeOfUnit>';
$xml_post_string .= '</unitNumberDetail>';
$xml_post_string .= '</numberOfUnit>';
$xml_post_string .= '<paxReference>';
$xml_post_string .= '<ptc>ADT</ptc>';
$xml_post_string .= '<traveller>';
$xml_post_string .= '<ref>1</ref>';
$xml_post_string .= '</traveller>';
$xml_post_string .= '</paxReference>';
$xml_post_string .= '<fareOptions>';
$xml_post_string .= '<pricingTickInfo>';
$xml_post_string .= '<pricingTicketing>';
$xml_post_string .= '<priceType>ET</priceType>';
$xml_post_string .= '<priceType>RP</priceType>';
$xml_post_string .= '<priceType>RU</priceType>';
$xml_post_string .= '</pricingTicketing>';
$xml_post_string .= '</pricingTickInfo>';
$xml_post_string .= '</fareOptions>';
$xml_post_string .= '<travelFlightInfo />';
$xml_post_string .= '<itinerary>';
$xml_post_string .= '<requestedSegmentRef>';
$xml_post_string .= '<segRef>1</segRef>';
$xml_post_string .= '</requestedSegmentRef>';
$xml_post_string .= '<departureLocalization>';
$xml_post_string .= '<departurePoint>';
$xml_post_string .= '<locationId>NYC</locationId>';
$xml_post_string .= '</departurePoint>';
$xml_post_string .= '</departureLocalization>';
$xml_post_string .= '<arrivalLocalization>';
$xml_post_string .= '<arrivalPointDetails>';
$xml_post_string .= '<locationId>MIA</locationId>';
$xml_post_string .= '</arrivalPointDetails>';
$xml_post_string .= '</arrivalLocalization>';
$xml_post_string .= '<timeDetails>';
$xml_post_string .= '<firstDateTimeDetail>';
$xml_post_string .= '<date>171219</date>';
$xml_post_string .= '</firstDateTimeDetail>';
$xml_post_string .= '</timeDetails>';
$xml_post_string .= '</itinerary>';
$xml_post_string .= '</Fare_MasterPricerTravelBoardSearch>';
$xml_post_string .= '</soap:Body>';
$xml_post_string .= '</soap:Envelope>';

header('Content-Type: text/xml');
// echo $xml_post_string;

$headers = array(
"POST ".$wsap." HTTP/1.1",
"Host: noded2.test.webservices.amadeus.com",
"Content-Type: application/soap+xml; charset=utf-8",
"Content-Length: ".strlen($xml_post_string)
); 

$url = $soapUrl;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec($ch); 
curl_close($ch);


$soapUrl=”https://noded2.test.webservices.amadeus.com/“$wsap;
/*
$xml_post_string='XXXXXXXXX-xxxxxx 0riksvŠgen 559018Mantorp10';
*/
$xml\u post\u字符串=“”;
$xml_post_字符串='';
$xml_post_字符串='';
//$xml_post_字符串='2fc42c4e-d34f-414e-b064-d37acd6bdc9c';
$xml_post_string.=''.$MessageID';
$xml\u post\u字符串。='http://webservices.amadeus.com/FMPTBQ_18_1_1A';
$xml\u post\u字符串。='https://noded2.test.webservices.amadeus.com/“.$wsap”。”;
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_string.=''.$wbs_user_id'.';
$xml_post_string.=''.$nonce';
$xml_post_string.=''.$passworddigest';
$xml_post_string.=''.$created';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='30';
$xml_post_字符串='RC';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='1';
$xml_post_字符串='PX';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='ADT';
$xml_post_字符串='';
$xml_post_字符串='1';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='ET';
$xml_post_字符串='RP';
$xml_post_字符串='RU';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='1';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='NYC';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='MIA';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='171219';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
$xml_post_字符串='';
标题('Content-Type:text/xml');
//echo$xml\u post\u字符串;
$headers=数组(
“发布“$wsap.”HTTP/1.1“,
“主机:noded2.test.webservices.amadeus.com”,
“内容类型:应用程序/soap+xml;字符集=utf-8”,
“内容长度:”.strlen($xml\u post\u字符串)
); 
$url=$soapUrl;
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$URL);
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$xml_post_string);
curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$response=curl\u exec($ch);
卷曲关闭($ch);

只需添加
中的值,只需添加
中的值,因为这是一个与php相关的问题,向我们展示了一些php代码。到目前为止,您尝试了什么?问题已经解决。我错过了标题中的SOAPAction参数。因为这是一个与php相关的问题,向我们展示了一些php代码。到目前为止,您尝试了什么?问题已经解决。我错过了标题中的SOAPAction参数。