How to view SOAP fault details from Bing Ads API failure

431 Views Asked by At

I have a request I'm making to the Bing Ads API that looks like this:

var _campaignManagementService = new ServiceClient<ICampaignManagementService>(
    _authorizationData,
    apiEnvironment
);

var getCampaignRequest = new GetCampaignsByIdsRequest
{
    AccountId = <the-accountid-is-here>,
    CampaignIds = new List<long>() { <the-campaignid-is-here> }
};

var getCampaignResponse = (await _campaignManagementService.CallAsync((s, r) => s.GetCampaignsByIdsAsync(r), getCampaignRequest));

When I run this, an exception is thrown on the last line that reports:

"Invalid client data. Check the SOAP fault details for more information."

Unfortunately, using the API, I'm not seeing the details of the actual response. Is there a way to get at this info? (Short of rewriting the whole thing without using the API?)

1

There are 1 best solutions below

0
sommmen On

Edit:

Thanks to Panagiotis Kanavos I found the solution i think. This is for a different api (reporting) but it should look the same.

The exception has an InnerException that is of type System.ServiceModel.FaultException<Microsoft.BingAds.V13.Reporting.AdApiFaultDetail> or something similar. This has the Detail property with additional information:

enter image description here

Original post:

Can't seem to be able to easily inspect the SOAP request. But you can sniff the request with Fiddler classic The classic version is free.

enter image description here