Does anyone have any code about both getting and setting users OOF messages using Garethp/php-ews library by any chance?
(https://learn.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/aa563465(v=exchg.140))
(https://learn.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/aa493825(v=exchg.140))
I have tried the following
use garethp\ews\API\Type;
use garethp\ews\MailAPI;
use garethp\ews\API\Enumeration\DistinguishedFolderIdNameType;
use garethp\ews\API\Enumeration\UserConfigurationPropertyType;
use garethp\ews\API\Enumeration\GetUserOofSettingsRequestType;
$email = 'me#mycompany.com';
$host = 'myexchserver'; $username = 'myusername'; $password = 'mypassword';
$api = MailAPI::withUsernameAndPassword($host,$username,$password,["version" => 'Exchange2010_SP1', 'impersonation' => $email]);
$response = $api->getClient()->GetUserOofSettingsRequest(['Address' => 'someuser#mycompany.com']);
But get the following error.
Fatal error: Uncaught SoapFault exception: [Client] Function ("GetUserOofSettingsRequest") is not a valid method for this service in /Scripts/vendor/garethp/php-ews/src/API/NTLMSoapClient.php:119 Stack trace: #0 /Scripts/vendor/garethp/php-ews/src/API/NTLMSoapClient.php(119): SoapClient->__call() #1 /Scripts/vendor/garethp/php-ews/src/API/ExchangeWebServices/MiddlewareFactory.php(18): garethp\ews\API\NTLMSoapClient->__call() #2 /Scripts/vendor/garethp/php-ews/src/API/ExchangeWebServices.php(510): garethp\ews\API\ExchangeWebServices->garethp\ews\API\ExchangeWebServices\{closure}() #3 /Scripts/vendor/garethp/php-ews/src/API/ExchangeWebServices/MiddlewareFactory.php(32): garethp\ews\API\ExchangeWebServices->garethp\ews\API\{closure}() #4 /Scripts/vendor/garethp/php-ews/src/API/ExchangeWebServices.php(510): garethp\ews\API\ExchangeWebServices->garethp\ews\API\ExchangeWebServices\{closure}() #5 /Scripts/vendor/garethp/php-ews/src/API/ExchangeWebServices/MiddlewareFactory.php(48): garethp\ews\API\ExchangeWebServices->garethp\ew in /Scripts/vendor/garethp/php-ews/src/API/NTLMSoapClient.php on line 119
Thanks
Related
When a query is made, it retuns 404, invalid json error.
I use 8083 as port. Is there any another port for api.
Below is the code I use. Any help is welcome.
<?php
require '/vendor/autoload.php';
$client = new InfluxDB\Client('153.148.25.44', '8083');
$database = $client->selectDB('Meters');
$result = $database->getQueryBuilder()
->select('*')
->from('GDATA')
->limit(2)
->getResultSet()
->getPoints();
//$result = $database->query('select * from GDATAlimit LIMIT 5;');
//$points = $result->getPoints();
//$lastQuery = $client->getLastQuery();
echo '<pre>';
var_dump($result);
?>
Tested database connection, it is working.
Version is 0.13
Fatal error:
Uncaught exception 'InvalidArgumentException' with message 'Invalid JSON' in C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\ResultSet.php:30
Stack trace: #0 C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\Driver\Guzzle.php(100): InfluxDB\ResultSet->__construct('404 page not fo...')
#1 C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\Client.php(198): InfluxDB\Driver\Guzzle->query()
#2 C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\Database.php(78): InfluxDB\Client->query('Meters', 'SELECT * FROM "...', Array)
#3 C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\Query\Builder.php(261): InfluxDB\Database->query('SELECT * FROM "...')
#4 C:\xampp\htdocs\projectone\home.php(10): InfluxDB\Query\Builder->getResultSet()
#5 {main} thrown in C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\InfluxDB\ResultSet.php on line 30
API port for InfuxDB v0.13 is 8086. I was using 8083, which is used for web.
I am working on TNT SOAP based API, I am using below code but gets only error, I can`t understand what I am doing wrong ?
ini_set("default_socket_timeout",120);
$client = new SoapClient('https://uat.tntexpress.com.au/Webservices/Conservice/ConsignmentService.svc?wsdl');
$params = array(
'payingAccount' => '20003191',
'UserName' => 'NEX-APIT',
'Password' => 'NEX_APIPWT'
);
$response = $client->__soapCall('ProcessConsignmentRequest',$params);
print_r($response);
I am getting this error :
Fatal error: Uncaught SoapFault exception: [s:Client] The creator of this fault did not specify a Reason. in D:\xampp\htdocs\tnt\soap.php:11
Stack trace:
#0 D:\xampp\htdocs\tnt\soap.php(11): SoapClient->__soapCall('ProcessConsignm...', Array)
#1 {main} thrown in D:\xampp\htdocs\tnt\soap.php on line 11
I found here the working code tnt-express
I have tried below code for updating but it did not work it showed error code:
Fatal error: Uncaught SoapFault exception: [a:InternalServiceFault] Cannot create an abstract class. in D:\xampp\htdocs\bingTest\UpdateAccount.php:81 Stack trace: #0 D:\xampp\htdocs\bingTest\UpdateAccount.php(81): SoapClient->__call('UpdateAccount', Array) #1 D:\xampp\htdocs\bingTest\UpdateAccount.php(81): SoapClient->UpdateAccount(Object(BingAds\CustomerManagement\UpdateAccountRequest)) #2 D:\xampp\htdocs\bingTest\UpdateAccount.php(62): UpdateAccount(Object(BingAds\Proxy\ClientProxy), Object(BingAds\CustomerManagement\AdvertiserAccount)) #3 {main} thrown in D:\xampp\htdocs\bingTest\UpdateAccount.php on line 81
$wsdl = "https://clientcenter.api.sandbox.bingads.microsoft.com/Api/CustomerManagement/v9/CustomerManagementService.svc?singleWsdl";
$proxy = ClientProxy::ConstructWithAccountAndCustomerId($wsdl, $UserName, $Password, $DeveloperToken, $AccountId, null, null);
$last_modified_time=GetAccount($proxy,$AccountId);
$account_obj=new AdvertiserAccount();
$account_obj->AccountType='Advertisement';
$account_obj->CountryCode="US";
$account_obj->CurrencyType="USD";
$account_obj->Id=$AccountId;
$account_obj->LastModifiedTime=$last_modified_time;
$account_obj->Name="Test Account";
$account_obj->AccountLifeCycleStatus='Pause';
UpdateAccount($proxy, $account_obj);
function GetAccount($proxy,$AccountId)
{
$account_obj=new GetAccountRequest();
$account_obj->AccountId=$AccountId;
return $proxy->GetService()->GetAccount($account_obj)->Account->LastModifiedTime;
}
function UpdateAccount($proxy, $update_account_info)
{
$request = new UpdateAccountRequest();
$request->Account = $update_account_info;
return $proxy->GetService()->UpdateAccount($request);
}
In case if you still need a solution. You need to do this:
$encodedAccount = new \SoapVar(
$account,
SOAP_ENC_OBJECT,
'AdvertiserAccount',
'https://bingads.microsoft.com/Customer/v9/Entities'
);
$request->Account = $encodedAccount;
Getting this error while using soap service php :
Fatal error: Uncaught SoapFault exception: [Client] Function ("getProxy") is not a valid method for this service in C:\webserver\www\feeder\index.php:7 Stack trace: #0 C:\webserver\www\feeder\index.php(7): SoapClient->__call('getProxy', Array) #1 C:\webserver\www\feeder\index.php(7): SoapClient->getProxy() #2 {main} thrown in C:\webserver\www\feeder\index.php on line 7
here's my code :
<?php
$wsdl = "http://localhost:8182/fg/live.php?wsdl";
$username = "aaaaa";
$password = "123456";
$client = new SoapClient($wsdl);
$proxy = $client->getProxy();
$token = $proxy->GetToken($username, $password);
var_dump("Get Token = ".$token);
$table = $proxy->ListTable($token);
var_dump("Tabel = ".$table);
?>
There's something wrong with my code ?
Please have a look at the PHP SoapClient Doku, there is no getProxy-Method. The client itself calls the functions defined in wsdl:
$token = $client->GetToken();
$client->ListTable($token);
And make shure, that you check $token, if it's really a single variable, or if it is an object.
I have PHP code that is managing mailing lists using the Provisioning API. Visitors are able to opt in or out of the mailing list via a web form. It has been working for ~6 months and stopped working 10/1/2013.
I am using this code for testing:
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Gapps');
$service = Zend_Gdata_Gapps::AUTH_SERVICE_NAME ;
$username = 'my_username';
$password = 'my_password';
$domain = 'my_domain';
$email = 'test-email#domain.com';
$email_list = 'test-list';
$client = Zend_Gdata_ClientLogin::getHttpClient($username, $password, $service);
$gdata = new Zend_Gdata_Gapps($client, $domain);
$gdata->addRecipientToEmailList($email, $email_list);
I'm receiving the following error message:
PHP Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400
Invalid request URI' in /usr/share/php/Zend/Gdata/App.php:716\nStack trace:
#0 /usr/share/php/Zend/Gdata.php(219): Zend_Gdata_App->performHttpRequest('POST', 'https://apps-ap...', Array, '<atom:entry xml...', 'application/ato...', NULL)
#1 /usr/share/php/Zend/Gdata/App.php(908): Zend_Gdata->performHttpRequest('POST', 'https://apps-ap...', Array, '<atom:entry xml...', 'application/ato...')
#2 /usr/share/php/Zend/Gdata/Gapps.php(247): Zend_Gdata_App->post(Object(Zend_Gdata_Gapps_EmailListRecipientEntry), 'https://apps-ap...', NULL, NULL, Array)
#3 /usr/share/php/Zend/Gdata/App.php(983): Zend_Gdata_Gapps->post(Object(Zend_Gdata_Gapps_EmailListRecipientEntry), 'https://apps-ap...', NULL, NULL, Array)
#4 /usr/share/php/Zend/Gdata/Gapps.php(840): Zend_Gdata_App->insertEntry(Object(Zend_Gdata_Gapps_EmailListRecipientEntry), 'https://apps-ap...', 'Zend_Gdata_Gapp...')
#5 /usr/share/php/Zend/Gdata/Gapps.php(1625): Zend_G in /usr/share/php/Zend/Gdata/App.php on line 716
Can anyone tell me what happened? And what I need to do to get this working again?
Thanks,
B
Google completely remove support for emaillists. Use groups instead lists.
Example:
instead $gdata->addRecipientToEmailList($email, $email_list)
use $gdata->addMemberToGroup($email, $group_name)
deleteEmailList -> deleteGroup
createEmailList -> createGroup
getEmailListRecipientFeed -> retrieveAllMembers
See full syntax in Zend docs:
http://framework.zend.com/manual/1.12/en/zend.gdata.gapps.html