Hi,
There are few suggestions here which I have.
1. Using OAuth instead of BBAuth - We have recently made few changes and BBAuth will be deprecated soon. I would recommend usage of OAuth and you can get your keys from the YDN Mail page. (https://developer.apps.yahoo.com/dashboard/createKey.html)
2. Usage of JSON instead of SOAP
For more details please check the document here in
YDNGetting back to your issue, can you please paste the entire response here? Also I would like to understand if you are getting the same issue using JSON.
Please find a snippet below which will help you to quickly try it out. Also please download the
org.json library from
json.org and add it to your classpath.
CODE
// JSON Endpoint
public static String JSONURL = "http://mail.yahooapis.com/ws/mail/v1.1/jsonrpc";
//JSON Object
JSONObject jsonObjSend = new JSONObject();
//URL
String URL = JSONURL + "?appid=" + appPr.getProperty("APP_ID") + "&WSSID=" + wssid;
//API Method
String key= "ListFolders";
String value = "[{}]";
// Parameter of the api
JSONArray param = new JSONArray(value);
jsonObjSend.put("params", param);
jsonObjSend.put("method", key);
URL = appPr.getProperty("JSON_ENDPOINT") + "?appid=" +APP_ID+ "&WSSID=" + wssid;
// JSON object to hold the information, which is sent to the server
JSONObject jsonObjRecv = HttpClient.SendHttpPost(URL, jsonObjSend, cookie);
CODE
public static JSONObject SendHttpPost(String URL, JSONObject jsonObjSend, String cookieVal) {
try {
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httpPostRequest = new HttpPost(URL);
StringEntity se= new StringEntity(jsonObjSend.toString());
// Set HTTP parameters
httpPostRequest.setHeader("Cookie", cookieVal);
httpPostRequest.setHeader("Accept", "application/json");
httpPostRequest.setHeader("Content-type", "application/json");
httpPostRequest.setEntity(se);
long t = System.currentTimeMillis();
HttpResponse response = (HttpResponse) httpclient.execute(httpPostRequest);
// Get hold of the response entity (-> the data):
HttpEntity entity = response.getEntity();
if (entity != null) {
// Read the content stream
InputStream instream = entity.getContent();
Header contentEncoding = response.getFirstHeader("Content-Encoding");
// convert content stream to a String
String resultString = convertStreamToString(instream);
instream.close();
// Transform the String into a JSONObject
JSONObject jsonObjRecv = new JSONObject(resultString);
return jsonObjRecv;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Also I am assuming that your APP_ID has a necessary access to the API's you are using. Thanks
--
Ram
I have verified that if I hit this same URL, only without setting the cookie, that I get an immediate return, with:
SOAP-ENV:Client.MissingCredentialsMissing credentials.
I am not sure why requesting the exact same URL with my valid cookie causes the time out.
This leaves me to believe that it's something on the Yahoo! side.