I'm trying to add an HTTP header (containing an oAuth token) to my Shopping API request, but the format of the Shopping call is different from other APIs, and I can't see a clear way to add headers.
For example, with the Finding API I can create a Finding Client object and add headers to that, as follows:
(using the WSDL com.ebay.developer.Finding\FindingService.wsdl)
FindingServicePortTypeClient client = new FindingServicePortTypeClient();
OperationContextScope scope = new OperationContextScope(client.InnerChannel);
HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty();
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
But with the Shopping API, there seems to be no obvious 'Client'-style object that I can create and add headers to, just a 'Shopping' object where I can specify the endpoint URL (with parameters), and methods to specify which call to make. There are also request and response type objects for the calls, but no obvious way to add headers to those either:
Here's my current code to access the Shopping API:
(using the WSDL http://developer.ebay.com/webservices/latest/ShoppingService.wsdl)
Shopping shop = new Shopping();
GetCategoryInfoRequestType request = new GetCategoryInfoRequestType();
GetCategoryInfoResponseType response = new GetCategoryInfoResponseType();
request.CategoryID = "115280";
response = shop.GetCategoryInfo(request);
I've already followed and read all of the links in the API documentation, and while they all say that HTTP headers can be sent to the Shopping API, none explain how to do it.
As you can probably tell I'm not the most experienced developer, so any help would be greatly appreciated. Thanks.