Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error in SOAP client when executing behind firewall  RSS feed

 
Mohan Natarajan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to connect to Google API, I get the following exception:
[SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: api.google.com; targetException=java.lang
.IllegalArgumentException: Error opening socket: api.google.com]
at org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:324)
at org.apache.soap.rpc.Call.invoke(Call.java:205)
at GoogleClient.searchGoogle(GoogleClient.java:49)
at GoogleClient.main(GoogleClient.java:71)
The code I used is:
System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "202.54.36.98");
System.getProperties().put("proxyPort", "80");
Call call = new Call ();
String encodingStyleURI = "http://schemas.xmlsoap.org/soap/encoding/";
call.setEncodingStyleURI(encodingStyleURI);
call.setTargetObjectURI ("urn:GoogleSearch");
call.setMethodName ("doGoogleSearch");
Vector params = new Vector ();
params.addElement(new Parameter("key", String.class, "18hec2Mmfwq1qgLyw3weQyFbhIMZRsRA", null));
params.addElement(new Parameter("q", String.class, "Web Service", null));
call.setParams (params);
Response resp = call.invoke (urlGoogle,"urn:GoogleSearchAction");

I was able to connect to other sites, like www-ind.cricinfo.org and get a page, whereas not to this one. Please let me know what is wrong with this code.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!