xml — регистрация клиента API объявлений Bing в переполнении стека

Мне нужна помощь в php мыле, чтобы отправить запрос xml, доступный по следующей ссылке.

http://msdn.microsoft.com/en-us/library/dn451287.aspx

Также не знаю, какова будет ссылка для отправки запроса.

0

Решение

    // For Customer managment use the wsdl "https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v9/CustomerManagementService.svc?singleWsdl"

// Include files from bing client lib here - Or better yet - use composer to autoload -

use BingAds\Proxy\ClientProxy;
use BingAds\CustomerManagement\Address;
use BingAds\CustomerManagement\Customer;
use BingAds\CustomerManagement\Industry;
use BingAds\CustomerManagement\LanguageType;
use BingAds\CustomerManagement\AdvertiserAccount;
use BingAds\CustomerManagement\Account;
use BingAds\CustomerManagement\CurrencyType;
use BingAds\CustomerManagement\SignupCustomerRequest;
use BingAds\CustomerManagement\AccountType;// you should download the client lib - then should be able to do like so -
// i assume that you have developer token, and access token already for re seller account already ...

// also NOTE the soap Var advertiser account - or this won't work - you will get abstract class error ...

// Disable WSDL caching.

ini_set("soap.wsdl_cache_enabled", "0");
ini_set("soap.wsdl_cache_ttl", "0");

// Specify your credentials.

$UserName = "<UserNameGoesHere>";
$Password = "<PasswordGoesHere>";
$DeveloperToken = "DeveloperTokenGoesHere>";
$AccountId = <AccountIdGoesHere>;$proxy = ClientProxy::ConstructWithAccountAndCustomerId($wsdl, $UserName, $Password, $DeveloperToken, $AccountId, null, null);$address = new Address();
$address->CountryCode = 'US';
$address->City = 'Some CIty';
$address->Line1 = 'Some Address';
$address->PostalCode = 60010;
$address->StateOrProvince = 'IL';

// create customer
$customer = new Customer();
$customer->CustomerAddress = $address;
$customer->Industry = Industry::Automotive;
$customer->MarketCountry = 'US';
$customer->MarketLanguage = LanguageType::English;
$customer->Name = 'No Account';// create advertiser
$advertiseAccount = new AdvertiserAccount();
$advertiseAccount->AccountType = AccountType::Advertiser;
$advertiseAccount->Type = CurrencyType::USDollar;
$advertiseAccount->CurrencyType = CurrencyType::USDollar;
$advertiseAccount->Name ='No Account';
$advertiseAccount->PaymentMethodType = NULL;$request = new SignupCustomerRequest();
$request->Customer = $customer;
$request->Account = new \soapVar($advertiseAccount, SOAP_ENC_OBJECT, 'AdvertiserAccount', $proxy->getNamespace() . '/Entities');
$request->ParentCustomerId = \Models\Bingads\User\BingAuth::CUSTOMER_ID_RS;
$request->ApplicationScope = ApplicationType::Advertiser;

try{
$response = $proxy->GetService()->SignupCustomer($request);
}catch(\Exception $e){
error_log($e->getMessage());
}

return $response;
0

Другие решения

Других решений пока нет …