Grow your business by advertising on bing, MSN, Xbox, and more!
As in every live system there are many things that can go wrong. Although we put a lot of efforts into ensuring the system is responsive, reliable, with descriptive error messages, there are still cases when we return a generic error message "Internal Error". In these exception cases we look in logs and try to understand what went wrong and how to fix it. “Internal error” usually means “There is a case in application that doesn’t comply with the assumptions we’ve made nor is appropriate to return a descriptive error message and you’ll have to rely on us to fix this for you.” In the case I am going to describe this is not the case – there is a way you can fix things.
In our error logs we found an exception related to desterilizing request header so we’ve investigated possible reasons and found that a SOAP header in the request with duplicate elements could return the “Internal Error” response.
This is how the wrong SOAP request looks:
1: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
2: <s:Header>
3: <h:ApplicationToken i:nil="true" xmlns:h="https://adcenter.microsoft.com/api/advertiser/v5"
4: xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
5: <h:CustomerAccountId xmlns:h="https://adcenter.microsoft.com/api/advertiser/v5">
6: 256490
7: </h:CustomerAccountId>
8:
9: <h:DeveloperToken xmlns:h="https://adcenter.microsoft.com/api/advertiser/v5"
10: xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
11: <h:Value>CannotRevealThat</h:Value>
12: </h:DeveloperToken>
13:
14: <h:DeveloperToken xmlns:h="https://adcenter.microsoft.com/api/advertiser/v5"
15: xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
16: <h:Value>CannotRevealThat</h:Value>
17: </h:DeveloperToken>
18:
19: <h:UserCredentials xmlns:h="https://adcenter.microsoft.com/api/advertiser/v5"
20: xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
21: <h:Username>MySuperSecretuserName</h:Username>
22: <h:Password>CannotRevealThatAsWell</h:Password>
23: </h:UserCredentials>
24: </s:Header>
25: <s:Body>
26: <GetCampaignsByAccountIdRequest xmlns="https://adcenter.microsoft.com/api/advertiser/v5">
27: <AccountId>123456</AccountId>
28: </GetCampaignsByAccountIdRequest>
29: </s:Body>
30: </s:Envelope>
Note that DeveloperToken in SOAP Header is duplicated. In order to return a valid non-error response, all elements in the header should have only one instance.After removing it, everything is fine and the "Internal Error" message is gone.
Thus we’ve just added one more step in the list when you receive "Internal Error" response:
Hope this helps,Galin Iliev, SDE, adCenterhttp://www.galcho.com/blog
Sign in to adCenter | Need an account? Sign up now
Follow us on Twitter @adCenter & @MSAdvertising | Find us on Facebook and YouTube | Share your thoughts and ask questions in the Forums | Subscribe to the adCenter API Blog