BingAds / BingAds-PHP-SDK

Other
56 stars 45 forks source link

Issue with how CampaignManagement Service are working #24

Closed chiragvels closed 7 years ago

chiragvels commented 7 years ago

Hello,

There is issue with services called for campaign management. The Service Client end point return by API request has issue and giving error Invalid Client Data.

API Request are returning this [ReportingVersion11] => https://api.bingads.microsoft.com/Api/Advertiser/Reporting/v11/ReportingService.svc [CampaignManagementVersion11] => https://campaign.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/V11/CampaignManagementService.svc

The Url for CampaignManagementVersion11 must be v11 and not V11

So Under vendor/microsoft/bingads/src/V11/CampaignManagement/CampaignManagementServiceSettings.php end point needs to update.

Thanks,

chiragvels commented 7 years ago

Hello @eric-urban ,

This might not be correct, because with samples I think campaignManagement SOAP is not preparing with proper client data, I am investigating same, but can you please help me what I may be missing.

I am getting campaign proxy properly but not the values here GetCampaignsByAccountId.

$listCampaigns = CampaignManagementHelper::GetCampaignsByAccountId( $accountId, CampaignManagementHelper::AllCampaignTypes)->Campaigns;

Also SOAP exceptional also not giving proper data. The result for same is Last SOAP request/response: Fault Code: s:Server Fault String: Invalid client data. Check the SOAP fault details for more information

SO, It is not exception properly.

Also not getting this values so that I can have proper Idea where I need to look, from Samples example $GLOBALS['Proxy']->GetWsdl()

Thanks,

eric-urban commented 7 years ago

Hi @chiragvels -

To view SOAP exception details you can print immediately after the service call as demonstrated here:

print $GLOBALS['Proxy']->GetWsdl() . "\n";
print $GLOBALS['Proxy']->GetService()->__getLastRequest()."\n";
print $GLOBALS['Proxy']->GetService()->__getLastResponse()."\n";

Note: There is a GetCampaignsByAccountId example here.

I hope this helps, Eric

chiragvels commented 7 years ago

Hello @eric-urban ,

I am printing the SOAP exactly same as you mentioned but getting error, which is due to null SOAP request.

Yes, I am using same example. But received strange error.

Please note that I am able to get accounts at this line. $accounts = CustomerManagementHelper::SearchAccountsByUserId($user->Id)->Accounts;

Also I am able to get the most the basic reports that I have tried till now.

But I am not able to use Campaign Management service.

I am getting error like this Last SOAP request/response: Fault Code: s:Server Fault String: Invalid client data. Check the SOAP fault details for more information

The operation failed with the following faults: OperationError Code: 106 Error Code: UserIsNotAuthorized Message: The user does not represent a authorized developer. Please see MSDN documentation for more details about the error code output above.

Should I missing something here?

Thanks,

chiragvels commented 7 years ago

Hello Eric,

Any solutions here?

Thanks,

eric-urban commented 7 years ago

@chiragvels - Sorry for the delay. We have replied via the forum.

chiragvels commented 7 years ago

Ok, Eric, I will be replying in the forum.