Ebeo / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

.net api calling you tube service fails unless Fiddler is loaded... #401

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Created C# code to call YouTube service to download videos for a given user.
2. Call the code in debug mode.  The service call times out, says Execution of 
request failed: 
http://gdata.youtube.com/feeds/api/users/DisneyOnBroadway/uploads"
Also:  InnerException:  "Unable to connect to the remote 
server"}    System.Exception {System.Net.WebException}
3. But if I load Fiddler 2 to monitor the web traffic to try to get more 
information on the problem, the Service Call works fine...

What is the expected output? What do you see instead?
See above...

What version of the product are you using? On what operating system?
Windows XP
Visual Studio 2010 .NET 4.0, Silverlight 4 calling WCF Service.  The WCF 
Service calls the You Tube/Google API...

Please provide any additional information below.

Code for calling the Service:
YouTubeRequestSettings ytrSettings = new 
YouTubeRequestSettings("DTGYouTubeVideoRequestor", "MYDEVELOPERKEYGOESHERE");

            ytrSettings.Timeout = 60000;

            YouTubeRequest ytRequest = new YouTubeRequest(ytrSettings);

            Uri uri = new Uri("http://gdata.youtube.com/feeds/api/users/DisneyOnBroadway/uploads");

            Feed<Video> videoFeed = ytRequest.Get<Video>(uri);

            List<DTGVideo> dtgVideos = new List<DTGVideo>();

            foreach (Video video in videoFeed.Entries)
            {
                DTGVideo dtgVideo = new DTGVideo();
                dtgVideo.VideoTitle = video.Title;
                dtgVideo.VideoURL = video.WatchPage.AbsoluteUri;
                dtgVideo.VideoId = video.VideoId;
                if (video.Thumbnails.Count > 0)
                {
                    dtgVideo.VideoThumbnailURL = video.Thumbnails[0].Url;
                }
                dtgVideos.Add(dtgVideo);
            }

Original issue reported on code.google.com by mark_a_b...@msn.com on 7 Jul 2010 at 4:30

GoogleCodeExporter commented 9 years ago
Would you mind sharing the fiddler output? Also, i thought silverlight can not 
make crossdomain calls, did that change?

Original comment by fman...@gmail.com on 13 Jul 2010 at 4:03

GoogleCodeExporter commented 9 years ago

Original comment by fman...@gmail.com on 13 Jul 2010 at 4:03

GoogleCodeExporter commented 9 years ago
I'll rerun it with Fiddler and upload the results...I'm not calling the 
Google/You Tube Service directly from Silverlight.  I'm calling it from a WCF 
Service.  Silverlight is calling my Service.

Silverlight can make cross domain calls though as long as there is a cross 
domain policy file on the server it's calling that allows it.  I think this is 
a similar behavior to how Flash works...

Thanks

Original comment by mark_a_b...@msn.com on 13 Jul 2010 at 4:12

GoogleCodeExporter commented 9 years ago
Here is my Fiddler Output that works...

thanks.

Original comment by mark_a_b...@msn.com on 13 Jul 2010 at 4:43

Attachments:

GoogleCodeExporter commented 9 years ago
I can't reproduce it, if the issue is still valid can you share a solution that 
shows the error?

Original comment by ccherub...@google.com on 11 Feb 2011 at 4:42

GoogleCodeExporter commented 9 years ago
I'm not working on that project anymore and I can't remember what the fix was.  
I know that I got it working, but I can't remember how...If I ever get to 
revisit that project, I'll try to make sure I post the solution/work around.  I 
think it had to do with proxy settings somehow, but I can't remember.

sorry/thanks.

mark

Original comment by mark_a_b...@msn.com on 11 Feb 2011 at 6:40