question

coparts24 avatar image
0 Likes"
coparts24 asked ·

Getting "500 internal server error" in getSellerProfiles - Business Policies Management API

Hi guys, I am trying to get seller profiles using Business Policies Management API in C#. The following code gives me "System.Net.WebException" with "500 internal server error". It is weird, because the same Request I use for the Shopping and Finding API and it works very well. The difference are only headers and end point. I've tried to google and search the issue within the ebay developer forum, but didn't found any related issues to mine. Can anyone help me with this? What I am missing in the request? Thanks in advance. The Code (C#): string xmlRequest = " " + " true "; //WebRequest request = WebRequest.Create(" http://svcs.sandbox.ebay.com/services/selling/v1/SellerProfilesManagementService";); WebRequest request = WebRequest.Create(" https://svcs.ebay.com/services/selling/v1/SellerProfilesManagementService";); request.ContentType = "text/xml"; request.Method = "POST"; request.Headers.Add("X-EBAY-SOA-SERVICE-NAME", "SellerProfilesManagementService"); request.Headers.Add("X-EBAY-SOA-OPERATION-NAME", "getSellerProfiles"); request.Headers.Add("X-EBAY-SOA-SERVICE-VERSION", "1.0.0"); request.Headers.Add("X-EBAY-SOA-GLOBAL-ID", "EBAY-DE"); request.Headers.Add("X-EBAY-SOA-SECURITY-TOKEN", Token); request.Headers.Add("X-EBAY-SOA-REQUEST-DATA-FORMAT", "XML"); byte[] byteArray = Encoding.UTF8.GetBytes(xmlRequest); request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); dataStream.Dispose(); WebResponse response = request.GetResponse(); //<-- error here dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); string output = reader.ReadToEnd(); reader.Close(); reader.Dispose(); System.Diagnostics.Debug.WriteLine(output); Used docu: [ http://developer.ebay.com/Devzone/business-policies/Concepts/MakingACall.html][1] [ http://developer.ebay.com/Devzone/business-policies/CallRef/getSellerProfiles.html][2] [1]: http://developer.ebay.com/Devzone/business-policies/Concepts/MakingACall.html [2]: http://developer.ebay.com/Devzone/business-policies/CallRef/getSellerProfiles.html
c#getsellerprofileswebexception
· 1
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I have tried some additional actions: 1. Tried directly to send request using: https://svcs.ebay.com/services/selling/v1/SellerProfilesManagementService?X-EBAY-SOA-OPERATION-NAME=getSellerProfiles&X-EBAY-SOA-SERVICE-NAME=SellerProfilesManagementService&X-EBAY-SOA-SERVICE-VERSION=1.0.0&X-EBAY-SOA-SECURITY-TOKEN=__token__&X-EBAY-SOA-RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD∈cludeDetails=true and getting message: *Authentication failed : Validation of the authentication token in API request failed.* But the token is 100% correct
0 Likes 0 · ·
shulmani_developer.support avatar image
1 Like"
shulmani_developer.support answered ·
Hi, Can you try the SOAPUI sample: https://github.com/eBayDeveloper/eBay_APICall_Request_Templates/tree/master/BusinessPoliciesManagementAPI and see if you are able to make the api call successfully. Cheers!!!
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

dtjones1988 avatar image
0 Likes"
dtjones1988 answered ·
invalid api version header gave me a 500 internal server error"
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

coparts24 avatar image
0 Likes"
coparts24 answered ·
Hi, Thank you very much for the answer, it was very helpful. The problem was in the request xml, at the ebay developer documentation stays wrong example of request xml: Original XML Request (as in the documentation): string xmlRequest = " " + " true "; XML Request must be like this: string xmlRequest = @" true "; Thank you for the help, problem solved. Regards
· 1 · Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi, The first request is a SOAP request and the second one is a xml request. So the endpoints will change depending on what kind of a request that you are sending. So always make sure that you pay attention to that. Cheers!!!
0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.