Temando API をテストして、予約を作成しようとしています。マニュアル Temando API R1_11 Developers Guide の指示に従いました。
私の問題は、次の必要な情報を使用して makeBookingByRequest の呼び出しを作成するときです。
エラー 500 : 内部サーバー エラーが返されます。それが許可に関係している場合は、すでに修正しています。
ちなみに、残りのコードは次のとおりです。
ini_set("soap.wsdl_cache_enabled", "1");
$client = new SoapClient("https://training-api.temando.com/schema/XXXX/server.wsdl", array('soap_version' => SOAP_1_2));
$username = "xxxxxxxxxx";
$password = "xxxxxxxxxx";
$headerSecurityStr = "<Security><UsernameToken><Username>".$username."</Username><Password>".htmlentities($password)."</Password></UsernameToken></Security>";
$headerSecurityVar = new SoapVar($headerSecurityStr, XSD_ANYXML);
$soapHeader = new SoapHeader('wsse:http://schemas.xmlsoap.org/ws/2002/04/secext', 'soapenv:Header', $headerSecurityVar);
$client->__setSoapHeaders(array($soapHeader));
$destination = array();
$destination["destinationCountry"] = "AU";
$destination["destinationCode"] = "2000";
$destination["destinationSuburb"] = "Sydney";
$destination["destinationIs"] = "Residence";
$destination["destinationResPostalBox"] = "N";
$destination["destinationResUnattended"] = "N";
$destination["destinationResInside"] = "N";
$destination["destinationResLimitedAccess"] = "N";
$destination["destinationResHeavyLift"] = "N";
$origin = array();
$origin["originDescription"] = "ABC Suppliers";
$origin["originBusUnattended"] = "N";
$origin["originBusInside"] = "N";
$origin["originBusHeavyLift"] = "N";
$origin["originBusTailgateLifter"] = "N";
$origin["originBusContainerSwingLifter"] = "N";
$quote = array();
$quote["totalPrice"] = "110.00";
$quote["basePrice"] = "100.00";
$quote["tax"] = "10.00";
$quote["currency"] = "AUD";
$quote["deliveryMethod"] = "Off-peak";
$quote["etaFrom"] = "2";
$quote["etaTo"] = "3";
$quote["guaranteedEta"] = "Y";
$payment = array();
$payment["paymentType"] = "Credit Card";
$payment["cardType"] = "Mastercard";
$payment["cardExpiryDate"] = "05-2010";
$payment["cardNumber"] = "5163190000000000";
$payment["cardName"] = "JANE DOE";
$comments = "No Comment";
$reference = "ABC200000";
$makeBookingByRequest = array();
$makeBookingByRequest["anything"] = $anything1;
$makeBookingByRequest["anytime"] = $anytime;
$makeBookingByRequest["anywhere"] = $anywhere;
$makeBookingByRequest["general"] = $general;
$makeBookingByRequest["origin"] = $origin;
$makeBookingByRequest["destination"] = $destination;
$makeBookingByRequest["quote"] = $quote;
$makeBookingByRequest["payment"] = $payment;
$makeBookingByRequest["instructions"] = $instructions;
$makeBookingByRequest["comments"] = $comments;
$makeBookingByRequest["reference"] = $reference;
$anythings = array();
$anything1 = array();
$anything1["class"] = "Freight";
$anything1["mode"] = "Less than load";
$anything1["packaging"] = "Carton";
$anything1["qualifierFreightGeneralFragile"] = "N";
$anything1["distanceMeasurementType"] = "Centimetres";
$anything1["weightMeasurementType"] = "Kilograms";
/** get the data below from POST DATA **/
$anything1["length"] = "30";
$anything1["width"] = "10";
$anything1["height"] = "10";
$anything1["weight"] = "10";
$anything1["quantity"] = "1";
$anything1["description"] = "Contains bottle lids and liquors.";
/*****************/
array_push($anythings, $anything1);
$anywhere = array();
$anywhere["itemNature"] = "Domestic";
$anywhere["itemMethod"] = "Door to Door";
$anywhere["originCountry"] = "AU";
$anywhere["originCode"] = "4000";
$anywhere["originSuburb"] = "Brisbane";
$anywhere["originIs"] = "Business";
$anywhere["originBusUnattended"] = "N";
$anywhere["originBusDock"] = "Y";
$anywhere["originBusForklift"] = "N";
$anywhere["originBusLoadingFacilities"] = "N";
$anywhere["originBusInside"] = "N";
$anywhere["originBusLimitedAccess"] = "N";
$anywhere["originBusHeavyLift"] = "N";
$anywhere["originBusTailgateLifter"] = "N";
$anywhere["originBusContainerSwingLifter"] = "N";
$anywhere["destinationCountry"] = "AU";
$anywhere["destinationCode"] = "2000";
$anywhere["destinationSuburb"] = "Sydney";
$anywhere["destinationIs"] = "Residence";
$anywhere["destinationResPostalBox"] = "N";
$anywhere["destinationResUnattended"] = "N";
$anywhere["destinationResInside"] = "N";
$anywhere["destinationResLimitedAccess"] = "N";
$anywhere["destinationResHeavyLift"] = "N";
$anytime = array();
$anytime["readyDate"] = "2012-06-01";
$anytime["readyTime"] = "PM";
$general = array();
$general["goodsValue"] = "2000.00";
呼び出し方法:
try{
$makeBookingByRequestResponse = $client->makeBookingByRequest($makeBookingByRequest);
p($makeBookingByRequestResponse);
}catch (SoapFault $exception){
p($exception);
// Nothing is done with the exception yet. Will be processed later in the display code.
}
function p($arr){
echo '<pre>';
print_r($arr);
echo '</pre>';
}
Temando APIの使用経験のある方はいらっしゃいますか? どんな助けでも大歓迎です。