这是我的第一个问题..永远......对于这个杰出而虔诚的论坛,如果我因为这个问题的内容而受到斥责,我就不会亲自接受......
我试图通过下面的代码调用ebay的推销服务,并继续获得#34;请求因空响应而失败。"错误的回应
static void Main(string[] args)
{
//Use the custom class
customMerchandisingService svc = new customMerchandisingService();
//Set the production URL
svc.Url = "http://svcs.ebay.com/MerchandisingService?";
GetMostWatchedItemsRequest request = new GetMostWatchedItemsRequest();
request.categoryId = "617";
MerchandisingServiceItemResponse response = svc.getMostWatchedItems(request);
foreach (Item item in response.itemRecommendations)
{
//process results
string title = item.title;
string itemID = item.itemId;
}
}
class customMerchandisingService : MerchandisingAPI.MerchandisingService
{
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest req = (HttpWebRequest)base.GetWebRequest(uri);
//Set the AppID, Operation, Service, Protocol and Version as HTTP Headers
req.Headers.Add("EBAY-SOA-CONSUMER-ID", "Your AppID");
req.Headers.Add("X-EBAY-SOA-OPERATION-NAME", "getMostWatchedItems");
req.Headers.Add("X-EBAY-SOA-SERVICE-NAME", "MerchandisingService");
req.Headers.Add("X-EBAY-SOA-MESSAGE-PROTOCOL", "SOAP11");
req.Headers.Add("X-EBAY-SOA-SERVICE-VERSION", "1.1.0");
return req;
}
}
我用Google搜索了一下,并阅读了以下帖子:
"The request failed with an empty response" when calling a web service
我尝试过和我的httpeepee一起玩,然后继续做空。基本上我希望不是我,eBay上的一些网络开发人员(祝福他的心)至少应该受到指责。
我想我希望这个论坛上有人能够针对eBay的API进行开发,可以确认商品推销服务今天对他们有效,在这种情况下,我想我还需要把头撞在墙上。
提前致谢。