cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Response code 302, When accessing Google search API from Webdynpro

Former Member
0 Kudos

I am developing Webdynpro application in which i have provided Google search facility by using Google search API as web service. But when i am executing my application and search for some expression then it gives "Service Call Exception : Invalid Response code 302".

So if anybody can solve this problem then please help me.

Thanks,

Bhavik

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I have specified my proxy IP and port in that file. I have also specified username. In that same file i have specified Target address as http://api.google.com/search/beta2. I hope this address is correct. Please verify this link in yr application also. For statefull communication i have taken Use HTTP Cookie based sessions. Is it corretct?

For your paasword problem, u can write following code where u creating Request object and setting yr license key. Before calling setStart() method of request object u need to call _setPassword() method of request object....

Ok i think it may help u.....

And also please verify my lport_1.ip file as well.

Thanks,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

It seems that you must be making the wrong service call or wrong URI. I would check to see that the target address defined in the wsdl port file is correct (lport1_.lp). I am just guessing since thats what the response code 302 sorta references. To learn more about the response code goto http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Also double check your Google API license if its correct. I was able to successfully create the Google WD app but im facing a 407 response code(my company's proxy) and for some reason i can't define the password in the port file so i can't get around it. If you ever figure it out please let me know.. (wael.aoudi@aramco.com)

Thanks...

-wael

Former Member
0 Kudos

For your problem you can set password when you giving request.... Method is : _setPassword("password")....

I think that will help you.....

I m using this address for google Search API : http://api.google.com/search/beta2

Is it correct or not???

And where i can find lport1_.ip file?

Former Member
0 Kudos

Thats the correct target!! I dont know why you get the 302 response..you must have missed something..cos i didnt get that problem.. but you know maybe after i bypass the proxy (if i ever do) then i will get the same error... have you looked at the Best Practices google tutorial posted on sdn. look for it under Web Dynpro.

You can access the port file using the package explorer(window/showview/packageexplorer) find your project and expand it. then expand "src/packages" then expand <yourpackagenamespace>.proxies you will find a file called <i><b>lport1_1.lp</b></i>. double click and it will open for editing/modifying. notice there that you can not apply your proxy password.

Please let me know the exact steps to invoke the password method, do i need to modify the non generated classes?

Thanks,

Wael

I hope this helps !!