Results 1 to 1 of 1
  1. #1
    getstarted is offline Member
    Join Date
    Jan 2009
    Posts
    9
    Rep Power
    0

    Default NTLM Authentication; cannot call aspx page from java

    HttpClient client = new HttpClient();
    client.getState().setCredentials(AuthScope.ANY,
    new NTCredentials(userName, pwd, host, domain) );
    System.out.println(httpServiceURL);

    method = new GetMethod(httpServiceURL);
    method.setDoAuthentication( true );
    int status = client.executeMethod(method);
    System.out.println(status + "\n" + method.getResponseBodyAsString());

    Any help is greatly appreciated. Thanks,

    This is running fine if i run locally, but when I deploy it to weblogic, it is failing.

    Java Code:
    	private void Temp() throws Exception
    	{
    		String userName = "username";
    		String pwd = "password";
    		String domain = "domain";
    		String host = "hostName";
    		String httpServiceURL = "<<url>>";
    		HttpMethodBase method = null;
    		try {
    			HttpClient client = new HttpClient();
    			client.getState().setCredentials(AuthScope.ANY,
    							new NTCredentials(userName, pwd, host, domain) );
    			System.out.println(httpServiceURL);
    			
    			method = new GetMethod(httpServiceURL);
    			method.setDoAuthentication( true );			
    			int status = client.executeMethod(method);
    			System.out.println(status + "\n" + method.getResponseBodyAsString());
    		}
    		catch(Exception e)
    		{
    			System.out.println("Error: " + e.toString());
    			if (method != null)
    				method.releaseConnection();
    		}
    	}
    The IIS aspx page has Integrated Windows Security enabled.
    Last edited by getstarted; 04-15-2009 at 01:33 AM.

Similar Threads

  1. how to call servlet from the very first jsp page
    By R O C K Y in forum Advanced Java
    Replies: 6
    Last Post: 07-04-2012, 05:20 PM
  2. bypass NTLM login
    By ruchsriv in forum Web Frameworks
    Replies: 0
    Last Post: 03-30-2009, 09:23 AM
  3. java mail 530 authentication required --help
    By ravinder.kadiyan in forum Java Servlet
    Replies: 1
    Last Post: 04-30-2008, 11:08 AM
  4. Problem with NTLM ,data not posting to the server
    By raviprakash in forum JavaServer Faces (JSF)
    Replies: 3
    Last Post: 01-03-2008, 04:33 PM
  5. how to call a dll from java
    By katie in forum Advanced Java
    Replies: 3
    Last Post: 12-10-2007, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •