On Wed, 2007-02-14 at 21:00 +0530, Lalit Sahoo wrote:
> Hi All,
>  
> Can anybody help me?
>  
> Is it necessary to use HttpClient class?
>  

No, it is not. The SSL tunneling, request recovery, redirects and
authentication will not be handled automatically. That's all. 


> If I will use following approach what will be the disadvantage?

It depends on what you want to achieve

Oleg


>  
> 
> 1. Create a connection manager
> 
>  
> 
>             MultiThreadedHttpConnectionManager connManager = new 
> MultiThreadedHttpConnectionManager ();
> 
>  
> 
> 2. Create a host configuration
> 
>  
> 
>             HostConfiguration hostConfig = new HostConfiguration ();
> 
>  
> 
> 3. Set the host and port for host configuration
> 
>  
> 
>             hostConfig.set (hostName, portNumber)
> 
>  
> 
> 4. Create an HttpState instance 
> 
>  
> 
>             UsernamePasswordCredentials userCredentials = new 
> UsernamePasswordCredentials (userName, password);
> 
>                 AuthScope authScope = new AuthScope (hostName, portNumber, 
> realm, authenticationScheme);
> 
>                 HttpState httpState = new HttpState ();
> 
>                 httpState.setCredentials (authScope, userCredentials);
> 
>  
> 
> 5. Get an http connection with timeout:
> 
>  
> 
>             HttpConnection httpConnection = 
> connManager.getConnectionWithTimeout (hostconfig, 1000);
> 
>  
> 
> 6. Create an instance of get method:
> 
>  
> 
>             
> 
> String uri = "http://172.24.19.79:7001/SimpleWebSimulator/SOAPAgent";;
> 
> GetMethod getMethod = new GetMethod (uri);
> 
>  
> 
> 7. To execute this method:
> 
>  
> 
>             getMethod.execute (httpState, httpConnection);
> 
>  
> 
> Regards,
> 
> Lalit
> 


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

Reply via email to