Answered by:
Not all images appearing when running ImageRequest

Question
-
Hi
Just wondering has any else had problem with displaying images using:
request.Image = new net.live.search.api.ImageRequest();
Some images appear and some are just the red X in both IE and FF, i'm only display 10 images per page.
Example that appears: http://ts4.images.live.com/images/thumbnail.aspx?q=345750510527&id=c2e3344c1d097a73f073a2eef4ee6440
This example returns a 404 http://ts4.images.live.com/images/thumbnail.aspx?q=274701160147&id=8aacf8bf4b3c25a6b10917af2c315da8
But on the live website all images return ok.
Thanks
George
Tuesday, December 2, 2008 4:00 PM
Answers
-
George,
We found something fishy in your website's results.
There seems to be a problem with the XML decoding of the built-in entities.
If you use the SOAP or XML interfaces of our API, you need to translate the five built-in entities of XML,
-
& for &
-
< for <
-
> for >
-
" for "
-
' for '
it looks that your code uses the URL of the thumbnails as-is, and that contains often an "&" that was not translated to a "&". That would explain why you get consistent 404s on those resources.
Please look into that and let me know if this fixes the problem
HTH
--Alessandro
Friday, December 5, 2008 5:18 AM -
All replies
-
We are currently working to fix an issue on the image backend that could explain the problem you are seeing - the latencies of a part of the system are much higher than they should be.
It should all be normal within 24 hours.
HTH
--Alessandro
Tuesday, December 2, 2008 11:48 PM -
Hi Alessandro
Has the problem been fixed, as i'm still getting the same problem.
Regards
George
Wednesday, December 3, 2008 10:56 PM -
Just escalated to the image search team. This is not right.
Sorry
--Alessandro
Thursday, December 4, 2008 9:13 AM -
Hi Alessandro
Just uploaded to one of my live websites and tried there, still the same problem, if you need the domain name to see the problem, just let me know.
George
Thursday, December 4, 2008 11:05 AM -
That would actually help a lot. Could you please let me know the domain where to see a consistent repro?
Thanks
--Alessandro
Thursday, December 4, 2008 9:56 PM -
Hi Alessandro
The domain is 'now removed' if you select images and enter pooley bridge(top left of page), on the 1st page you will see some images not appearing, if you enter hotels, on the 3rd page some images are not appearing, disneyworld on the 3rd page images are not appearing.
If on your search you get a: 'Sorry an error has occured' message, just re-enter your search and the results will appear.
The error is caused by 'NullReferenceException' but on a retry images appear.
This website is just a test website and as such not a fully working site.
Regards
George
Thursday, December 4, 2008 10:54 PM -
George,
We found something fishy in your website's results.
There seems to be a problem with the XML decoding of the built-in entities.
If you use the SOAP or XML interfaces of our API, you need to translate the five built-in entities of XML,
-
& for &
-
< for <
-
> for >
-
" for "
-
' for '
it looks that your code uses the URL of the thumbnails as-is, and that contains often an "&" that was not translated to a "&". That would explain why you get consistent 404s on those resources.
Please look into that and let me know if this fixes the problem
HTH
--Alessandro
Friday, December 5, 2008 5:18 AM -
-
Hi Alessandro
Thanks that fixed the problem, had you use .Replace("","") on the specails characters as for some reason
HttpUtility.UrlDecode was not doing the job.
Regards
George
Friday, December 5, 2008 8:08 AM -
Actually UrlDecode did do its job.
The problem in this case is that the decoding that you need to do at this level is XML decoding, not url unescaping - it is effectively a different operation.
HTH
--Alessandro
Saturday, December 6, 2008 6:16 PM -
Hi Alessandro
Thanks, this opens up a further question, i'm using SOAP, how would i use XML decoding in this case, as my code is:
string
checkForNullsInMediaURL = MSNImageResults.Thumbnail.Url;imageResult.SearchImageMediaURL =
(checkForNullsInMediaURL ?? "").ToLower().Replace("&", "&").Replace("<", "<").Replace(">", ">").Replace(""", "\"").Replace("'", "'"); asHttpUtility
.UrlDecode was not changing & to & etcDo you have a link i could read up on this.
Regards
George
Saturday, December 6, 2008 11:06 PM