Google Adword API + PHP - php

Hai I am trying to integrate Google Adword API .. I am not having any devloper token for under MCC (My client center) account .
I am using this code ... But its not working
If you have any answer for this problem then please help me ... thanks in advance
<?php
require_once 'Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
$username = "abc#mail.com";
$password = "abc";
$currencyCode = "USD";
$developerToken = "$username++$currencyCode";
$user = new AdWordsUser(null, $username, $password, $developerToken);
$user->SetDefaultServer("https://adwords-sandbox.google.com/");
$user->LogAll();
$user->SetClientId(null);
try {
$campaignService = $user->GetService("CampaignService", 'v201306');
$page = $campaignService->get(new Selector());
} catch (Exception $e) {
}
$managedCustomerService = $user->GetService('ManagedCustomerService', 'v201306');
$selector = new Selector();
$selector->fields = array('Login', 'CustomerId', 'Name');
$page = $managedCustomerService->get($selector);
$accounts = array();
foreach ($page->entries as $account) {
if ($account->customerId > 0) {
$accounts[] = $account;
}
}
foreach ($accounts as $account) {
print "Customer ID: {$account->customerId}\n";
}
$customerId = $accounts[0]->customerId;
$user->SetClientId($customerId);
$budgetService = $user->GetService('BudgetService', 'v201306');
$budget = new Budget();
$budget->name = 'Test Budget #' . time();
$budget->period = 'DAILY';
$budget->amount = new Money((float) 10000000);
$budget->deliveryMethod = 'STANDARD';
$operations = array();
$operation = new BudgetOperation();
$operation->operand = $budget;
$operation->operator = 'ADD';
$operations[] = $operation;
$result = $budgetService->mutate($operations);
$budget = $result->value[0];
$campaignService = $user->GetService("CampaignService", 'v201306');
$campaign = new Campaign();
$campaign->name = "Test Sandbox Account #" + time();
$campaign->status = "ACTIVE";
$campaign->biddingStrategy = new ManualCPC();
$campaign->budget = new Budget();
$campaign->budget->budgetId = $budget->budgetId;
$networkSetting = new NetworkSetting();
$networkSetting->targetGoogleSearch = TRUE;
$campaign->networkSetting = $networkSetting;
$campaign->settings = array(new KeywordMatchSetting(false));
$operation = new CampaignOperation();
$operation->operand = $campaign;
$operation->operator = 'ADD';
$operations = array($operation);
$result = $campaignService->mutate($operations);
print_r($result);
?>
I am getting this error ::
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://adwords-sandbox.google.com//api/adwords/mcm/v201306/ManagedCustomerService?wsdl' : failed to load external entity "https://adwords-sandbox.google.com//api/adwords/mcm/v201306/ManagedCustomerService?wsdl" in /home/profiles/public_html/testing/seoteam/q/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php:169 Stack trace: #0 /home/profiles/public_html/testing/seoteam/q/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php(169): SoapClient->SoapClient('https://adwords...', Array) #1 /home/profiles/public_html/testing/seoteam/q/src/Google/Api/Ads/AdWords/Lib/AdWordsSoapClient.php(53): AdsSoapClient->__construct('https://adwords...', Array, Object(AdWordsUser), 'ManagedCustomer...', 'https://adwords...') #2 /home/profiles/public_html/testing/seoteam/q/src/Google/Api/Ads/AdWords/v201306/ManagedCustomerService.php(3660): AdWordsSoapClient->__construct('https://adwords...', Array, Object(AdWordsUser), 'ManagedCustomer...', 'https://adwor in /home/profiles/public_html/testing/seoteam/q/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 169

The Adwords API sandbox functionality is deprecated. You can use a test account while you wait for your token to be approved: Test accounts documentation

If you still keep getting this error even with Test accounts, check my answer at https://stackoverflow.com/a/41622876/674965

Related

how can i overcome this fatal error when i was run this SOAP API?

i was used the sms API in my Bluehost hosting. when i was run the code it shown like
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://smeapps.mobitel.lk:8585/EnterpriseSMSV3/EnterpriseSMSWS?wsdl' : failed to load external entity "http://smeapps.mobitel.lk:8585/EnterpriseSMSV3/EnterpriseSMSWS?wsdl" in /storage/ssd4/825/11729825/public_html/sms/sms_backend.php:58 Stack trace: #0 /storage/ssd4/825/11729825/public_html/sms/sms_backend.php(58): SoapClient->SoapClient('http://smeapps....') #1 /storage/ssd4/825/11729825/public_html/sms/sms_backend.php(101): getClient() #2 /storage/ssd4/825/11729825/public_html/sms/sms_backend.php(27): createSession('', 'esyyyyy', 'xxxx', '') #3 {main} thrown in /storage/ssd4/825/11729825/public_html/sms/sms_backend.php on line 58
here this is my code
<?php
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
//$alias = $_REQUEST['alias'];
$message = $_REQUEST['message'];
$number = $_REQUEST['numbers'];
$session=createSession('',$username,$password,'');
sendMessages($session,'XXXX',$message,$number,0); // 1 for promotional messages, 0 for normal message
closeSession($session);
$session=createSession('',$username,$password,'');
getMessagesFromShortCode($session,"shortcode");
getMessagesFromLongNumber($session,"longnum");
closeSession($session);
//create soap client
function getClient()
{
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient("http://smeapps.mobitel.lk:8585/EnterpriseSMSV3/EnterpriseSMSWS?wsdl");
return $client;
}
//serviceTest
function serviceTest($id,$username,$password,$customer)
{
$client = getClient();
$user = new stdClass();
$user->id = '';
$user->username = $username;
$user->password = $password;
$user->customer = '';
$serviceTest = new stdClass();
$serviceTest->arg0 = $user;
return $client->serviceTest($serviceTest);
}
//create session
function createSession($id,$username,$password,$customer)
{
$client = getClient();
$user = new stdClass();
$user->id = $id;
$user->username = $username;
$user->password = $password;
$user->customer = $customer;
$createSession = new stdClass();
$createSession->user = $user;
$createSessionResponse = new stdClass();
$createSessionResponse = $client->createSession($createSession);
return $createSessionResponse->return;
}
//check if session is valid
function isSession($session)
{
$client = getClient();
$isSession = new stdClass();
$isSession->session = $session;
$isSessionResponse = new stdClass();
$isSessionResponse = $client->isSession($isSession);
return $isSessionResponse->return;
}
//send SMS to recipients
function sendMessages($session,$alias,$message,$recipients,$messageType)
{
$client=getClient();
$smsMessage= new stdClass();
$smsMessage->message=$message;
$smsMessage->messageId="";
$smsMessage->recipients=$recipients;
$smsMessage->retries="";
$smsMessage->sender=$alias;
$smsMessage->messageType=$messageType;
$smsMessage->sequenceNum="";
$smsMessage->status="";
$smsMessage->time="";
$smsMessage->type="";
$smsMessage->user="";
$sendMessages = new stdClass();
$sendMessages->session = $session;
$sendMessages->smsMessage = $smsMessage;
$sendMessagesResponse = new stdClass();
$sendMessagesResponse = $client->sendMessages($sendMessages);
return $sendMessagesResponse->return;
}
//send Unicoded SMS to recipients
function sendMessagesMultiLang($session,$alias,$message,$recipients,$messageType)
{
$client=getClient();
$smsMessageMultiLang = new stdClass();
$smsMessageMultiLang->message=$message;
$smsMessageMultiLang->messageId="";
$smsMessageMultiLang->recipients=$recipients;
$smsMessageMultiLang->retries="";
$smsMessageMultiLang->sender=$alias;
$smsMessageMultiLang->messageType=$messageType;
$smsMessageMultiLang->sequenceNum="";
$smsMessageMultiLang->status="";
$smsMessageMultiLang->time="";
$smsMessageMultiLang->type="";
$smsMessageMultiLang->user="";
$sendMessagesMultiLang = new stdClass();
$sendMessagesMultiLang->session = $session;
$sendMessagesMultiLang->smsMessageMultiLang = $smsMessageMultiLang;
$sendMessagesMultiLangResponse = new stdClass();
$sendMessagesMultiLangResponse = $client->sendMessagesMultiLang($sendMessagesMultiLang);
return $sendMessagesMultiLangResponse->return;
}
//send Campaign SMS to recipients
function sendCampaignMessages($session,$alias,$message,$recipients,$datetime,$multilanguage,$messageType)
{
$client=getClient();
$smsCampaignMessage = new stdClass();
$smsCampaignMessage->message = $message;
$smsCampaignMessage->messageId = "";
$smsCampaignMessage->recipients = $recipients;
$smsCampaignMessage->retries = "";
$smsCampaignMessage->sender = $alias;
$smsCampaignMessage->messageType=$messageType;
$smsCampaignMessage->sequenceNum = "";
$smsCampaignMessage->status = "";
$smsCampaignMessage->time = $datetime;
$smsCampaignMessage->type = "";
$smsCampaignMessage->user = "";
$smsCampaignMessage->esmClass = $multilanguage;
$sendCampaignMessages=new stdClass();
$sendCampaignMessages->session=$session;
$sendCampaignMessages->smsCampaignMessage=$smsCampaignMessage;
$sendCampaignMessagesResponse = new stdClass();
$sendCampaignMessagesResponse = $client->sendCampaignMessages($sendCampaignMessages);
return $sendCampaignMessagesResponse->return;
}
//renew session
function renewSession($session)
{
$client = getClient();
$renewSession = new stdClass();
$renewSession->session = $session;
$renewSessionResponse = new stdClass();
$renewSessionResponse = $client->renewSession($renewSession);
return $renewSessionResponse->return;
}
//close session
function closeSession($session)
{
$client = getClient();
$closeSession = new stdClass();
$closeSession->session = $session;
$client->closeSession($closeSession);
}
//retrieve messages from shortcode
function getMessagesFromShortCode($session,$shortCode)
{
$client = getClient();
$getMessagesFromShortCode = new stdClass();
$getMessagesFromShortCode->session = $session;
$getMessagesFromShortCode->shortcode = $shortCode;
$getMessagesFromShortcodeResponse = new stdClass();
$getMessagesFromShortcodeResponse->return = "";
$getMessagesFromShortcodeResponse = $client->getMessagesFromShortcode($getMessagesFromShortCode);
if(property_exists($getMessagesFromShortcodeResponse,'return'))
return $getMessagesFromShortcodeResponse->return;
else return NULL;
}
//retrieve delivery report
function getDeliveryReports($session,$alias)
{
$client = getClient();
$getDeliveryReports = new stdClass();
$getDeliveryReports->session = $session;
$getDeliveryReports->alias = $alias;
$getDeliveryReportsResponse = new stdClass();
$getDeliveryReportsResponse->return = "";
$getDeliveryReportsResponse = $client->getDeliveryReports($getDeliveryReports);
if(property_exists($getDeliveryReportsResponse,'return'))
return $getDeliveryReportsResponse->return;
else return NULL;
}
//retrieve messages from longnumber
function getMessagesFromLongNumber($session,$longNumber)
{
$client = getClient();
$getMessagesFromLongNumber = new stdClass();
$getMessagesFromLongNumber->session = $session;
$getMessagesFromLongNumber->longNumber=$longNumber;
$getMessagesFromLongNumberResponse = new stdClass();
$getmessagesFromLongNumberResponse->return = "";
$getMessagesFromLongNumberResponse = $client->getMessagesFromLongNumber($getMessagesFromLongNumber);
if(property_exists($getMessagesFromLongNumberResponse,'return'))
return $getMessagesFromLongNumberResponse->return;
else return NULL;
}
?>
this code works in Localhost very well... but in my hosting (Bluehost) it was shown fatal error like that.
can any one help me to resolve this error??
Thanks in advance
It turns out that you need to have the extension php_openssl enabled on your server for it to work.
You can do this yourself on most hosting services by going to your PHP settings -> look for the option php_openssl.dll or php_openssl and enable it.
If you have access to your php.ini file, you could look for the line that says extension=php_openssl.dll and if this has a ; at the start like this ;extension=php_openssl.dll, remove the ; from the start so it reads extension=php_openssl.dll.
This should solve it for you.

Call to undefined method stdClass::save() in yii framework

I am building chats pop up where one user will initiate conversation with another user.
In my initiatechat function i have the following error Call to undefined method stdClass::save().
Look at codes and find THIS SAVE FUNCTION ==>> the save() function that throw error.
If two users have already initiated conversation this error does not happen.
public function actionInitiatechat() {
if (isset($_POST)){
//$message = Myclass::checkPostvalue($_POST['message']) ? $_POST['message'] : "";
$senderId = Myclass::checkPostvalue($_POST['sender']) ? $_POST['sender'] : "";
$receiverId = Myclass::checkPostvalue($_POST['receiver']) ? $_POST['receiver'] : "";
$messageType = Myclass::checkPostvalue($_POST['messageType']) ? $_POST['messageType'] : "";
$sourceId = Myclass::checkPostvalue($_POST['sourceId']) ? $_POST['sourceId'] : "";
$timeUpdate = time();
$message = $_POST['message'];
$Products = Products::model()->findByPk($sourceId);
if(isset($Products) && $Products->approvedStatus == 0)
{
echo "error";
}
else
{
$criteria = new CDbCriteria;
$criteria->condition = "(user1 = '$senderId' AND user2 = '$receiverId') OR (user1 = '$receiverId' AND user2 = '$senderId')";
$chatModel = Chats::model()->find($criteria);
$encodeMsg = urlencode($message);
if (empty($chatModel)){
$newChat = new Chats();
$newChat->user1 = $senderId;
$newChat->user2 = $receiverId;
$newChat->lastMessage = $encodeMsg;
$newChat->lastToRead = $receiverId;
$newChat->lastContacted = $timeUpdate;
$newChat->save();
$criteria = new CDbCriteria;
$criteria->condition = "(user1 = '$senderId' AND user2 = '$receiverId') OR (user1 = '$receiverId' AND user2 = '$senderId')";
$chatModel = Chats::model()->find($criteria);
}
$chatModel->lastContacted = $timeUpdate;
if ($chatModel->user1 == $senderId){
$chatModel->lastToRead = $chatModel->user2;
}else{
$chatModel->lastToRead = $chatModel->user1;
}
$chatModel->lastMessage = $encodeMsg;
THIS SAVE FUNCTION ==>> $chatModel->save();
$messageModel = new Messages();
$messageModel->message = $encodeMsg;
$messageModel->messageType = $messageType;
$messageModel->senderId = $senderId;
$messageModel->sourceId = $sourceId;
$messageModel->chatId = $chatModel->chatId;
$messageModel->createdDate = $timeUpdate;
$messageModel->save();
}
echo "success";
}
}
else
{
echo "failed";
}
}
The statement below is presumably returning a "bare" object of type stdClass, which doesn't define a save() method, hence your error.
$chatModel = Chats::model()->find($criteria);
Run var_dump($chatModel); immediately after this statement and see what type of object you're getting.

Magento 1 API: order.list not working

I am using SOAP to use Magento 1 API. It works when I try to use sales_order.info. But when I try to receive the list of the sales, "NULL" is returned. So far I only used example codes from Magento, that's why I am wondering why it is not working.
$mage_url = 'https://myhost/api/?wsdl';
$mage_user = '######';
$mage_api_key = '#######';
$client = new SoapClient( $mage_url );
$session = $client->login( $mage_user, $mage_api_key );
//WORKING:
$sale = $client->call($session, 'sales_order.info', '416203797');
$firstname = $sale['customer_firstname'];
echo $firstname;
//NOT WORKING:
$result = $client->call($session, 'sales_order.list');
var_dump ($result); <-- (result is 'NULL')
Does anybody has an idea why?
check below answer and change as per your requirement. I did this code for my API and it's working perfect. here I have code for "sales_order.list" and "sales_order.info". you can get code as per your requirement.
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$config=array();
$config["hostname"] = "www.yoursitename.com";
$config["login"] = "username";
$config["password"] = "password";
$proxy = new SoapClient('http://'.$config["hostname"].'/index.php/api/soap/?wsdl', array('trace'=>1));
$sessionId = $proxy->login($config["login"], $config["password"]);
$result = array();
$orderlist = ($proxy->call($sessionId, 'sales_order.list', array(array('customer_id'=>array('eq'=>$_REQUEST['customer_id'])))));
$order = ($proxy->call($sessionId, 'sales_order.info', array(array('order_info'=>array('eq'=>$_REQUEST['order'])))));
//echo '<pre>';
//print_r($orderlist);
//print_r($order);
//echo '</pre>';
//$result = json_encode($orderlist);
if($orderlist){
$result['success'] = true;
$result['available'] = $orderlist;
$result['available'] = $order;
}
else{
$result['failed'] = false;
$result['not-available'] = error message;
}
echo json_encode($result);
?>

Redeclare function in loop

I'm stumped as to how I would get this working. I'm using the twitteroauth.php library and I am grabbing the users token and token secret from a db query. Here is the code:
while($row = mysql_fetch_array($m))
{
$connection = new TwitterOAuth($consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$consumerKey = "#####";
$consumerSecret = "#####";
$oauthToken = $row['oauth_token'];
$oauthTokenSecret = $row['oauth_token_secret'];
$userName = $row['username'];
$query = mysql_query("select url from retweets order by rand() limit 1");
$row = mysql_fetch_assoc($query);
$retweet = basename($row['url']);
$method = 'statuses/retweet/'.$retweet.'';
twitterOAuth($method, $connection->post($method), $connection->http_code, $userName);
}
If there are multiple results from mysql, it loops through and says:
Fatal error: Cannot redeclare random_from() (previously declared in /usr/share/nginx/www/twitteroauth/twitteroauth.php:199) in /usr/share/nginx/www/twitteroauth/twitteroauth.php on line 199
Since the $connection variable relies on $oauthToken and $oauthTokenSecret from the mysql query, I can't move it outside of the loop, so how would I make it so I can use it in each loop without redeclaring?
Thank you in advance!
Update: This is twitterOAuth
function twitterOAuth($method, $response, $http_code, $userName, $parameters = '') {
if($http_code == 200){
echo "retweeted successfully #".$userName."<br />";
}else{
echo "an error has occurred while retweeting #".$userName."";
echo "<br />";
print_r($response);
}
}
It needs to look like this...
while($row = mysql_fetch_array($m))
{
$consumerKey = "#####";
$consumerSecret = "#####";
$oauthToken = $row['oauth_token'];
$oauthTokenSecret = $row['oauth_token_secret'];
$userName = $row['username'];
$connection = new TwitterOAuth($consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$query = mysql_query("select url from retweets order by rand() limit 1");
$row = mysql_fetch_assoc($query);
$retweet = basename($row['url']);
$method = 'statuses/retweet/'.$retweet.'';
twitterOAuth($method, $connection->post($method), $connection->http_code, $userName);
}
You were declaring it before declaring the variables that you wanted to pass into it...

Create Booking with Temando API

I am testing Temando API and trying to create a Booking. I have followed the instructions given by their manual Temando API R1_11 Developers Guide.
My problem is that when I create the call makeBookingByRequest with the following required information:
Anythings, Anywhere, Anytime, General, Origin, Destination, Quote, Payment, Instructions, Comments, Promotion Code.
It returns an error 500 : Internal Server Error. If it's something got to do with the permission, I have already fixed that.
By the way here's the rest of my code:
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";
call method:
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>';
}
Is there anyone who has experience in using Temando API? Any help would be appreciated.
Try to create your SOAP request using soapUI. It's a free software very useful to deal with SOAP web services. When it works, you can focus on build this request using PHP.

Categories