c# ebay api, works on W7 but not on xp
I developed an application that use the "finditemsAdvanced" api call of ebay. It works without problem on windows 7 but when i try it on xp machines the function returns null!!!! I tried to debug it on xp, with vs2010 and vs 2008 but nothing!!!!
here the search class:
public SearchResult Search(Job searchedjob)
{
try
{
EbayFind service = new EbayFind();
service.Url = "http://svcs.ebay.com/services/search/FindingService/v1";
FindItemsAdvancedRequest findrequest = new FindItemsAdvancedRequest();
ItemFilter[] filtro = new ItemFilter[1];
int filter = 0;
//Tempo rimanente
filtro[filter] = new ItemFilter();
filtro[filter].name = ItemFilterType.EndTimeTo;
filtro[filter].value = new string[]
{
searchedjob.TimeLeft.ToString("yyyy-MM-ddTHH:mm:ss.000Z")
};
filter++;
findrequest.keywords = "canon";
findrequest.itemFilter = filtro;
findrequest.descriptionSearch = false;
// Setting the pagination
PaginationInput pagination = new PaginationInput();
pagination.entriesPerPageSpec开发者_如何转开发ified = true;
pagination.entriesPerPage = 25;
pagination.pageNumberSpecified = true;
pagination.pageNumber = 1;
findrequest.paginationInput = pagination;
findrequest.paginationInput = pagination;
// Creating an object to the BestMatchService class
FindItemsAdvancedResponse resp = service.findItemsAdvanced(findrequest);
SearchResult res = resp.searchResult;
return res;
}
and here the ebay call:
class EbayFind : FindingService
{
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
try
{
HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(uri);
request.Headers.Add("X-EBAY-SOA-SECURITY-APPNAME", "myappid");
request.Headers.Add("X-EBAY-SOA-OPERATION-NAME", "findItemsAdvanced");
request.Headers.Add("X-EBAY-SOA-SERVICE-NAME", "FindingService");
request.Headers.Add("X-EBAY-SOA-MESSAGE-PROTOCOL", "SOAP11");
request.Headers.Add("X-EBAY-SOA-SERVICE-VERSION", "1.0.0");
request.Headers.Add("X-EBAY-SOA-GLOBAL-ID", "EBAY-US");
return request;
}
catch (Exception ex)
{
throw ex;
}
}
}
This code works on w7 machines, i don't understand why "res" is always null on xp!!! The net framework installed is 3.5 and 4.0, it's not a framework issue i think. Any ideas??
Thanks!
Stab in the dark -- Windows Firewall.
Try disabling it in the control panel while debugging. If it makes a difference, configure an exception to allow the api calls from your application through.
精彩评论