Debt Consolidation - Debt Consolidation - Web directory - Debt Consolidation - Debt Consolidation

PDA

View Full Version : I need your kind help!


sierho
Mar 18th 2004, 7:58 am
I am a beginner in googleapi programing.when run a java programe,i got such
default information:
{com.google.soap.search.GoogleSearchFault: [SOAPException: faultCode=SOAP-ENV:Pro
tocol; msg=Unsupported response content type "text/html", must be: "text/xml". R
esponse was:
<html><body><div align="center"><table border="1" cellpadding="0" cellspacing="0
" width="400" bordercolordark="#C9E5B9" bordercolorlight="#C9E5B9"><tr><td bgcol
or="#C9E5B9" width="598"><p><font color="#000000" size="5">?????ó?§×??????????
í????</font></p></td></tr><tr><td align="center"><font size="4" color="#ff0000">
?ú??</font><form method="POST" action="http://gate3.sdu.edu.cn/memcgi/zhuce"><p>
?? ?§ ????<input type="text" name="username" size="13"></p><p>??????????<input
type="password" name="password" size="13"></p><p>×??ó???±??<input type="text"
name="timeout" size="8" value="30">(·???)</p><p><input type="submit" value="×?
?á" name="B1"></p><input type="hidden" name="url" value="http://216.239.51.104">
</form></td></tr></table></div><p align="center"><font color="#000000">×???????
???í????v4.2 2004?ê3??.</font></p></body></html>
]
at com.google.soap.search.GoogleSearch.doGetCachedPage(GoogleSearch.java
:233)
at goglcache.main(goglcache.java:14)}
what's wrong with my programe,what should i do to correct it?

And my programe is as follwing:

import com.google.soap.search.*;
import java.io.*;
public class goglcache
{
public static void main(String[] args)
{
try
{
GoogleSearch search=new GoogleSearch();
String clientKey = "C37Rqx5QFHLQQd7KCTsw2DcjakPA3e4e";
search.setKey(clientKey);
search.setOutputEncoding("GB2312");
byte[] pageText=search.doGetCachedPage(args[0]);
System.out.println(new String(pageText));
}
catch(GoogleSearchFault e)
{
e.printStackTrace();
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("Usage: java GoogleCacheDemo url");
}
}
}

digitalpoint
Mar 18th 2004, 8:50 am
Hmmmm... for whatever reason it looks like you are making the request to http://gate3.sdu.edu.cn/memcgi/zhuce the query request should be made to api.google.com/search/beta2

- Shawn

killer2021
Nov 11th 2008, 5:12 pm
Yea change it to api.google.com...

keyaa
Nov 11th 2008, 10:10 pm
Dude.. you just repeated the 4 ½ year old solution to an even older problem...

blackhat33
Dec 1st 2008, 7:15 am
Hmmmm... for whatever reason it looks like you are making the request to http://gate3.sdu.edu.cn/memcgi/zhuce the query request should be made to api.google.com/search/beta2

- Shawn

I saw you answer straight forward. Looks like you know what are you talking about. Do you have an ASP.NET code example for Ajax search API?
Even a PHP code is good (no nusoap please). Thanks.