As Adrian said it is difficult to say without some detail. One thing I can say is that you do not use UrlPostMethod. This class is deprecated. PostMethod provides the same functionality.

Mike

On Monday, June 9, 2003, at 05:24 PM, Zulfi Umrani wrote:

Following code throws IllegalArgumentException: host parameter is null!
Does any one know why?

HttpClient hc = new HttpClient();
        HttpState state = hc.getState();
        state.setCredentials("", new
UsernamePasswordCredentials("zulfi", "zulfi"));

        String urlstr = "http://localhost:9999/services1/test";;
        URL url = new URL(urlstr);

        UrlPostMethod post = new UrlPostMethod(urlstr);
        post.setDoAuthentication(true);

        post.addRequestHeader("Connection", "Keep-Alive");
        post.addRequestHeader("Content-Length", ""+msg.length());
        post.addRequestHeader("Content-Type", "text/xml;
charset=utf-8");

        InputStream reqis = new ByteArrayInputStream(msg.getBytes());
        
        post.setRequestBody(reqis);
        
        hc.executeMethod(post);



Thanks,
Zulfi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to