Re: ?meterware? WebConversation jar



On Wed, 27 May 2009 11:45:28 +0000, Thufir wrote:

Well, I didn't have the correct imports, and I suppose meterware is
legitimate. I didn't know that sax was required too. Anyhow, fixed:


package auth;

import com.google.gdata.util.AuthenticationException;
import com.google.gdata.util.ServiceException;
import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;
import java.io.IOException;
import java.net.MalformedURLException;
import static java.lang.System.out;
import org.xml.sax.SAXException;


public class Main {

private static String userPrefix, userSuffix = "@gmail.com", user,
password;

/**
* @param args the command line arguments
*/
public static void main(String[] args) throws MalformedURLException,
AuthenticationException, IOException, ServiceException, SAXException {
String sURL = "http://carcruises.com/"; +
"cruise_list.asp?month_select=6&”" +
"state=Pennsylvania";
WebConversation conversation = new WebConversation();
WebRequest request = new GetMethodWebRequest(sURL);
WebResponse response = conversation.getResponse(request);
out.println(response);
}
}



This would be a standard approach to doing something like:

1. First, get a valid SID token:

curl https://www.google.com/accounts/ClientLogin
-d Email=just_your_username_here_without_at_gmail_dot_com
-d Passwd=your_password_here
-d source=Google-cURL-Example
-d service=reader

http://blogs.igalia.com/dpino/?cat=5


programatically from Java? I wanted to use libcurl for Java but couldn't
find any sample java code.



thanks,

Thufir

.



Relevant Pages

  • Re: Hash table performance
    ... Java HotSpotClient VM ... @param args the command line arguments ... public static void main{ ... The results of profiling are as follows: ...
    (comp.lang.java.programmer)
  • cant launch link.exe or cl.exe from a java prog
    ... I have a big trouble with the link.exe and cl.exe. ... I try to lauch there from a java application and I don't ... public static void main{ ...
    (microsoft.public.vstudio.general)
  • Re: Question about sample Java application
    ... > private static String name; ... > public static void main{ ... In most of what I've been doing, when I have to do a Java ... application within that one .java file. ...
    (comp.lang.java.programmer)
  • Re: beginners question
    ... It must accept a String array as a parameter. ... public static void main ... When java tells you that it cannot find a method, ... requiring an applet viewer. ...
    (comp.lang.java)
  • JNI - unresolved _ZNSs4_Rep11_S_terminalE
    ... which (the main-driver) calls JAVA again to ... do the real work for processing the message. ... when starting the JAVA MainWrapper ... public static void main{ ...
    (comp.lang.java.programmer)