Amazon-Enabled Movie collection starter kit

I downloaded and installed the Amazon-Enabled Movie Collection starter kit (AmazonMovieCollection_1_3_vb_rtm.vsi).  When I tried to use the search online option I got the following error message:

There was a problem connecting to the web service.  Please verify that you are connected to the internet.  Additional details: The request failed with HTTP status 407: Proxy Authentication Required.

Is there a coding modification that can be made so I can supply the proxy server address and a user name and password

Thanks,

Fred Bernstein



Answer this question

Amazon-Enabled Movie collection starter kit

  • Chryso

    Are you required to use a proxy to browse internet Is IE having the proper settings to allow browsing

    What I have seen .NET automatically takes proxies in consideration for accessing websites and webservices.

    I just downloaded and built a default project and it works but I do not use proxies. Do you have a specific line of code you get this error



  • Beatrix

    Yes I am required to specify a proxy in the internet options settings for IE. According to the network support group, I must specify the proxy server and my network id and password in order for the proxy server to authenticate the application.

    This is the line of code where the error occurs:

    Try

    'request search results from the Web service passing in the user's search criteria

    searchResults = amazonService.SearchDVDs(Me.SearchTextBox.Text) <<<<<

    'data bind the search results to the form UI

    Me.DVDBindingSource.DataSource = searchResults

    Catch ex As Exception

    MsgBox(String.Format("There was a problem connecting to the Web service. Please verify that you are connected to the Internet. Additional details: {0}", ex.Message))

    My.Application.Log.WriteException(ex)

    Finally

    'set cursor back to the default now that work is done

    Me.Cursor = Cursors.Default

    End Try


  • Rpgforme

    I am not sure if this will make everything work but it seem to work for search at least. This is just a simple fix to make it work. You might want to extend it more.

    What I did first was to step through the code inside SearchDVDs to see exactly where it failed and what it seemed to do. It fails on the line below.

    'call the Web service and assign the response
    amazonResponse = My.WebServices.AWSECommerceService.ItemSearch(itemSearch)

    I had a look if I can set the proxy of My.WebServices.AWSECommerceService and it does have a Proxy property. It seems to be straight forward to add a proxy before it fails.

    I had to import System.Net in SimpleAmazonWS.vb and made the following addition in SearchDVDs method just before the line I mentioned above (around line 60). Comment out the Credentials line to supply user/password for the proxy. Change the proxy URI to point to your proxy server.

    Dim p As WebProxy = New WebProxy
    p.Address =
    New Uri("http://proxy.ams.chello.nl:8080"
    )
    'p.Credentials = New NetworkCredential("username", "password")
    My.WebServices.AWSECommerceService.Proxy = p

    You might need to do more changes to make all functionality to work but at least this is a starting point.



  • startlet

    Thank you very much for your help. I applied the changes that you suggested. I recieved the following error:

    There was a problem connecting to the Web service. Please verify that you are connected to the Internet. Additional details: Unable to cast object type 'System.String' to type 'System.Net|WebProxy'.

    The line of code that this occurred is:

    My.WebServices.AWSECommerceService.Proxy = "10.4.2.20"

    Without the double quotes I got a syntax error. Would you know what type of expression is expected after the equals sign

    Please excuse my ignorance. I am still very new to Visual Basic.

    Thanks for your help.

    Fred Bernstein


  • Ivan Selchenkov

    You are not using the code I suggested. Below it is repeated. Replace :8080 with the port you need to use if it is different. Uncomment the line p.Credentials and replace username with the user you need to use for the proxy and password should be replaced with the password.

    Dim p As WebProxy = New WebProxy
    p.Address =
    New Uri("http://10.4.2.20:8080"
    )
    'p.Credentials = New NetworkCredential("username", "password")
    My.WebServices.AWSECommerceService.Proxy = p



  • steveareno

    Your solution resolved the problem. I apologize, I should have read your original solution more carefully. Thank you very much for your help.
  • Amazon-Enabled Movie collection starter kit