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]

Reply via email to