本文介绍了结束返回后10多天​​的拍卖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的API / XML是工作的罚款与返回的从present结束,直到10天拍卖,但不工作后10天结束列表:

<一个href=\"http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByCategory&SERVICE-VERSION=1.11.0&SECURITY-APPNAME=AlexGo:::::::hiddin::::821eee8&RESPONSE-DATA-FORMAT=XML&categoryId=307&paginationInput.entriesPerPage=100&paginationInput.pageNumber=1&outputSelector=CategoryHistogram&sortOrder=EndTime&itemFilter(0).name=MinPrice&itemFilter(0).value=.01&itemFilter(1).name=MaxPrice&itemFilter(1).value=1000&itemFilter(2).name=ListingType&itemFilter(2).value=AuctionWithBIN&itemFilter(3).name=LocatedIn&itemFilter(3).value=US&itemFilter(4).name=EndTimeFrom&itemFilter(4).value=2011-08-24T10:23:00.000Z&itemFilter(5).name=EndTimeTo&itemFilter(5).value=2011-08-31T10:23:00.000Z\" rel=\"nofollow\">http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByCategory&SERVICE-VERSION=1.11.0&SECURITY-APPNAME=AlexGo:::::::hiddin::::821eee8&RESPONSE-DATA-FORMAT=XML&categoryId=307&paginationInput.entriesPerPage=100&paginationInput.pageNumber=1&outputSelector=CategoryHistogram&sortOrder=EndTime&itemFilter(0).name=MinPrice&itemFilter(0).value=.01&itemFilter(1).name=MaxPrice&itemFilter(1).value=1000&itemFilter(2).name=ListingType&itemFilter(2).value=AuctionWithBIN&itemFilter(3).name=LocatedIn&itemFilter(3).value=US&itemFilter(4).name=EndTimeFrom&itemFilter(4).value=2011-08-24T10:23:00.000Z&itemFilter(5).name=EndTimeTo&itemFilter(5).value=2011-08-31T10:23:00.000Z

下面是我如何我下载的结果:

 公共字符串下载(字符串URL)
{
    //用于构建整个输入
    StringBuilder的SB =新的StringBuilder();    //在每个读取操作中使用
    字节[] buf中=新的字节[32768]
    尝试
    {
        // prepare网页,我们将要求
        HttpWebRequest的要求=(HttpWebRequest的)
            WebRequest.Create(URL);        //执行请求
        HttpWebResponse响应=(HttpWebResponse)
            request.GetResponse();        //我们将通过响应流中读取数据
        流resStream = response.GetResponseStream();
        字符串tempString = NULL;
        诠释计数= 0;        做
        {
            //填充数据的缓冲区
            数= resStream.Read(BUF,0,buf.Length);            //确保我们读一些数据
            如果(计数!= 0)
            {
                //从字节ASCII文本翻译
                tempString = Encoding.ASCII.GetString(BUF,0,计数);                //继续生成字符串
                sb.Append(tempString);
            }
        }
        而(计数大于0); //更多的数据看?
    }
    赶上(例外)
    {        timer1.Enabled = FALSE;
        progressBar1.Visible = FALSE;
        msg.ForeColor = Color.Red;
        msg.Text =请稍后再试!
        msg.Visible =真;
    }
    //打印页面的源代码
    // MessageBox.Show(sb.ToString());
    返回sb.ToString();
}


解决方案

我真的不知道你有什么问题,我试着用的时间差相同的API小于10天,10天以上。

不到10天

<$p$p><$c$c>http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByCategory
&安培; SERVICE-VERSION = 1.11.0
与安全性,APPNAME =输入-APP-ID-HERE
&安培;响应数据格式的XML =
&放大器;的categoryId = 307
&安培; paginationInput.entriesPerPage = 100
&安培; paginationInput.pageNumber = 1
&outputSelector=CategoryHistogram&sortOrder=EndTime&itemFilter%280%29.name=MinPrice&itemFilter%280%29.value=0.01&itemFilter%281%29.name=MaxPrice&itemFilter%281%29.value=10000
&itemFilter%282%29.name=ListingType&itemFilter%282%29.value=AuctionWithBIN&itemFilter%283%29.name=LocatedIn&itemFilter%283%29.value=US
&安培; itemFilter%284%29.name = EndTimeFrom&放大器; itemFilter%284%29.value = 2011-08-06T07:52:48.000Z
&安培; itemFilter%285%29.name = EndTimeTo&放大器; itemFilter%285%29.value = 2011-08-10T07:52:48.000Z

10多天后

<$p$p><$c$c>http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByCategory
&安培; SERVICE-VERSION = 1.11.0
与安全性,APPNAME =输入-APP-ID-HERE
&安培;响应数据格式的XML =
&放大器;的categoryId = 307
&安培; paginationInput.entriesPerPage = 100
&安培; paginationInput.pageNumber = 1
&outputSelector=CategoryHistogram&sortOrder=EndTime&itemFilter%280%29.name=MinPrice&itemFilter%280%29.value=0.01&itemFilter%281%29.name=MaxPrice&itemFilter%281%29.value=10000
&itemFilter%282%29.name=ListingType&itemFilter%282%29.value=AuctionWithBIN&itemFilter%283%29.name=LocatedIn&itemFilter%283%29.value=US
&安培; itemFilter%284%29.name = EndTimeFrom&放大器; itemFilter%284%29.value = 2011-08-06T07:52:48.000Z
&安培; itemFilter%285%29.name = EndTimeTo&放大器; itemFilter%285%29.value = 2011-08-30T07:52:48.000Z

试试吧,它应该工作。

PS:对于我来说。无论你的陈述没有工作,我得到这样的:

<$p$p><$c$c><findItemsByCategoryResponse><ack>Failure</ack><errorMessage><error><errorId>12</errorId><domain>Marketplace</domain><severity>Error</severity><category>Request</category><message>Invalid约会时间value.</message><subdomain>Search</subdomain><parameter>END_TIME_FROM</parameter></error><error><errorId>12</errorId><domain>Marketplace</domain><severity>Error</severity><category>Request</category><message>Invalid约会时间value.</message><subdomain>Search</subdomain><parameter>END_TIME_TO</parameter></error></errorMessage><version>1.11.0</version><timestamp>2011-08-06T00:28:25.501Z</timestamp></findItemsByCategoryResponse>

更新:

易趣不允许任何拍卖将持续10多天。所以,如果你试图找到拍卖来源:8/24 8/30到,在当前的日期我们:8/08,你不会找到任何东西。因为如果拍卖今天上市,在最大,卖家可以把它挂牌出售,直到是08/18。

替换 AuctionWithBIN StoreInventory 从有上市10多天店得到结果。

My api/xml is working fine with returning auctions ending from present until 10 days but is not working for listings ending after 10 days:

http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByCategory&SERVICE-VERSION=1.11.0&SECURITY-APPNAME=AlexGo:::::::hiddin::::821eee8&RESPONSE-DATA-FORMAT=XML&categoryId=307&paginationInput.entriesPerPage=100&paginationInput.pageNumber=1&outputSelector=CategoryHistogram&sortOrder=EndTime&itemFilter(0).name=MinPrice&itemFilter(0).value=.01&itemFilter(1).name=MaxPrice&itemFilter(1).value=1000&itemFilter(2).name=ListingType&itemFilter(2).value=AuctionWithBIN&itemFilter(3).name=LocatedIn&itemFilter(3).value=US&itemFilter(4).name=EndTimeFrom&itemFilter(4).value=2011-08-24T10:23:00.000Z&itemFilter(5).name=EndTimeTo&itemFilter(5).value=2011-08-31T10:23:00.000Z

Here is how I am downloading results:

public string DownLoad(string url)
{
    // used to build entire input
    StringBuilder sb = new StringBuilder();

    // used on each read operation
    byte[] buf = new byte[32768];
    try
    {
        // prepare the web page we will be asking for
        HttpWebRequest request = (HttpWebRequest)
            WebRequest.Create(url);

        // execute the request
        HttpWebResponse response = (HttpWebResponse)
            request.GetResponse();

        // we will read data via the response stream
        Stream resStream = response.GetResponseStream();
        string tempString = null;
        int count = 0;

        do
        {
            // fill the buffer with data
            count = resStream.Read(buf, 0, buf.Length);

            // make sure we read some data
            if (count != 0)
            {
                // translate from bytes to ASCII text
                tempString = Encoding.ASCII.GetString(buf, 0, count);

                // continue building the string
                sb.Append(tempString);
            }
        }
        while (count > 0); // any more data to read?
    }
    catch (Exception)
    {

        timer1.Enabled = false;
        progressBar1.Visible = false;
        msg.ForeColor = Color.Red;
        msg.Text = "Please try after some time !!!";
        msg.Visible = true;
    }
    // print out page source
    // MessageBox.Show(sb.ToString());
    return sb.ToString();
}
解决方案

I am not really sure what is your problem, I tried the same API with the time difference less than 10 days and more than 10 days.

Less than 10 days

http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByCategory
&SERVICE-VERSION=1.11.0
&SECURITY-APPNAME=ENTER-APP-ID-HERE
&RESPONSE-DATA-FORMAT=XML
&categoryId=307
&paginationInput.entriesPerPage=100
&paginationInput.pageNumber=1
&outputSelector=CategoryHistogram&sortOrder=EndTime&itemFilter%280%29.name=MinPrice&itemFilter%280%29.value=0.01&itemFilter%281%29.name=MaxPrice&itemFilter%281%29.value=10000
&itemFilter%282%29.name=ListingType&itemFilter%282%29.value=AuctionWithBIN&itemFilter%283%29.name=LocatedIn&itemFilter%283%29.value=US
&itemFilter%284%29.name=EndTimeFrom&itemFilter%284%29.value=2011-08-06T07:52:48.000Z
&itemFilter%285%29.name=EndTimeTo&itemFilter%285%29.value=2011-08-10T07:52:48.000Z

More than 10 days

http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByCategory
&SERVICE-VERSION=1.11.0
&SECURITY-APPNAME=ENTER-APP-ID-HERE
&RESPONSE-DATA-FORMAT=XML
&categoryId=307
&paginationInput.entriesPerPage=100
&paginationInput.pageNumber=1
&outputSelector=CategoryHistogram&sortOrder=EndTime&itemFilter%280%29.name=MinPrice&itemFilter%280%29.value=0.01&itemFilter%281%29.name=MaxPrice&itemFilter%281%29.value=10000
&itemFilter%282%29.name=ListingType&itemFilter%282%29.value=AuctionWithBIN&itemFilter%283%29.name=LocatedIn&itemFilter%283%29.value=US
&itemFilter%284%29.name=EndTimeFrom&itemFilter%284%29.value=2011-08-06T07:52:48.000Z
&itemFilter%285%29.name=EndTimeTo&itemFilter%285%29.value=2011-08-30T07:52:48.000Z

Try it out, it should work.

PS: For me. both of your statements don't work, I get this:

<findItemsByCategoryResponse><ack>Failure</ack><errorMessage><error><errorId>12</errorId><domain>Marketplace</domain><severity>Error</severity><category>Request</category><message>Invalid date/time value.</message><subdomain>Search</subdomain><parameter>END_TIME_FROM</parameter></error><error><errorId>12</errorId><domain>Marketplace</domain><severity>Error</severity><category>Request</category><message>Invalid date/time value.</message><subdomain>Search</subdomain><parameter>END_TIME_TO</parameter></error></errorMessage><version>1.11.0</version><timestamp>2011-08-06T00:28:25.501Z</timestamp></findItemsByCategoryResponse>

Update:

eBay does not allow any auctions to last more than 10 days. So, if you try to find an auction from: 8/24 to 8/30, where current date us: 8/08, you will not find anything. Because if an auction is listed today, at max, a seller can put it up for sale is till 08/18.

Replace AuctionWithBIN with StoreInventory to get results from stores which has listings more than 10 days.

这篇关于结束返回后10多天​​的拍卖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 09:21