You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "and)" <an...@yandex.ru> on 2010/03/03 19:51:51 UTC

axis2 client how to disable cache?

hello

it is a my code
there are 2 same requests, but with difference authenticate parameters
the 1st user have access, and 2sh have no access on server
and the result of my code success for all users

if i will change by places 1st and 2nd request, that the result for all
users will denied access

i think that there some cache in httpclient or axis2, but i can not find how
to disable it

i have tried to use clientservice.cleanup() but no effect


public static void main(String[] args) throws Exception {

		
		
		{
			String userName = "user1";
			String password = "pass1";
			String host = "host";
			String domain = "domain;
			ReportService reportService = new ReportService(userName, password,
					host, domain);

			List<CatalogItem> r = reportService.getSubFolders("/");

			for (CatalogItem a : r) {
				System.out.println(a.getName());
			}
			
			System.out.println("1111111111111111111");
			System.out.println(reportService);
			System.out.println(reportService.rs);
			System.out.println(reportService.rs._getServiceClient());
			

		}
		
	
		
		
		
		{

			String userName1 = "user2";
			String password1 = "pass2";
			String host1 = "host";
			String domain1 = "domain";

			ReportService reportService1 = new ReportService(userName1, password1,
					host1, domain1);

			List<CatalogItem> r = reportService1.getSubFolders("/");

			for (CatalogItem a : r) {
				System.out.println(a.getName());
			}			
			
		}
		
		

	}


it is ReportService class

public final class ReportService {

    final ReportingService2005Stub rs;

    public ReportService(String userName, String password, String host,
String domain) throws Exception {
        rs = new ReportingService2005Stub();              
        
        List<String> authSchema = new ArrayList<String>();
        authSchema.add(HttpTransportProperties.Authenticator.NTLM);
        HttpTransportProperties.Authenticator ntlmAuthentication = new
HttpTransportProperties.Authenticator();
        
        ntlmAuthentication.setAuthSchemes(authSchema);

        ntlmAuthentication.setUsername(userName);
        ntlmAuthentication.setPassword(password);
        ntlmAuthentication.setHost(host);
        ntlmAuthentication.setDomain(domain);

        ntlmAuthentication.setPreemptiveAuthentication(false);
        
        Options options = new Options();

        options.setProperty(HTTPConstants.CHUNKED, "false");
        options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, "false");

       
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
ntlmAuthentication);
        rs._getServiceClient().setOptions(options);
                
    }
...................
-- 
View this message in context: http://old.nabble.com/axis2-client-how-to-disable-cache--tp27772148p27772148.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: axis2 client how to disable cache?

Posted by "and)" <an...@yandex.ru>.
i have wrote example ntlm connection in httpclient 3 and there no problem, 
it means that it is problem in axis2 or in my code
-- 
View this message in context: http://old.nabble.com/axis2-client-how-to-disable-cache--tp27772148p27780590.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: axis2 client how to disable cache?

Posted by "and)" <an...@yandex.ru>.
i think that 2nd code use connection from 1code if ntlm



-- 
View this message in context: http://old.nabble.com/axis2-client-how-to-disable-cache--tp27772148p27779297.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: axis2 client how to disable cache?

Posted by "and)" <an...@yandex.ru>.
thanks for your fast answer

i using iis5, and keep-alive is enabled there

if i set disable on keep-alive that for all users i get 

org.apache.axis2.AxisFault: Transport error: 401 Error: Access Denied
	at
org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:310)
	at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:200)

it problem only with ntlm, 
i have checked my code on Base authenticate and there no problems
-- 
View this message in context: http://old.nabble.com/axis2-client-how-to-disable-cache--tp27772148p27779074.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Accessing OperationContext from password callback handler

Posted by "Doughty, Michael" <Mi...@bmc.com>.
We would like to store credentials passed in through UsernameToken to the OperationContext so that they will be accessible from the implementation of the operation itself.  To do this we attempted to access the OperationContext from within the handle method of our implementation class for the CallbackHandler interface.  This came back as a null reference.

Is there any way to reference the OperationContext at this point so that we can pass the information along to the target operation's implementation?

RE: axis2 client how to disable cache?

Posted by Martin Gainty <mg...@hotmail.com>.
i noticed you are implementing a NTLM authenticator 

http://hc.apache.org/httpclient-3.x/authentication.html


as explained in the link for NTLM authentication the listening WebServer MUST support http-keepalive

I would strongly suggest requesting those details from your WebServer admin

ping back for any further questions....

anyone? 
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

 

> Date: Wed, 3 Mar 2010 10:51:51 -0800
> From: andromedagalaxy@yandex.ru
> To: axis-user@ws.apache.org
> Subject: axis2 client how to disable cache?
> 
> 
> hello
> 
> it is a my code
> there are 2 same requests, but with difference authenticate parameters
> the 1st user have access, and 2sh have no access on server
> and the result of my code success for all users
> 
> if i will change by places 1st and 2nd request, that the result for all
> users will denied access
> 
> i think that there some cache in httpclient or axis2, but i can not find how
> to disable it
> 
> i have tried to use clientservice.cleanup() but no effect
> 
> 
> public static void main(String[] args) throws Exception {
> 
> 
> 
> {
> String userName = "user1";
> String password = "pass1";
> String host = "host";
> String domain = "domain;
> ReportService reportService = new ReportService(userName, password,
> host, domain);
> 
> List<CatalogItem> r = reportService.getSubFolders("/");
> 
> for (CatalogItem a : r) {
> System.out.println(a.getName());
> }
> 
> System.out.println("1111111111111111111");
> System.out.println(reportService);
> System.out.println(reportService.rs);
> System.out.println(reportService.rs._getServiceClient());
> 
> 
> }
> 
> 
> 
> 
> 
> {
> 
> String userName1 = "user2";
> String password1 = "pass2";
> String host1 = "host";
> String domain1 = "domain";
> 
> ReportService reportService1 = new ReportService(userName1, password1,
> host1, domain1);
> 
> List<CatalogItem> r = reportService1.getSubFolders("/");
> 
> for (CatalogItem a : r) {
> System.out.println(a.getName());
> } 
> 
> }
> 
> 
> 
> }
> 
> 
> it is ReportService class
> 
> public final class ReportService {
> 
> final ReportingService2005Stub rs;
> 
> public ReportService(String userName, String password, String host,
> String domain) throws Exception {
> rs = new ReportingService2005Stub(); 
> 
> List<String> authSchema = new ArrayList<String>();
> authSchema.add(HttpTransportProperties.Authenticator.NTLM);
> HttpTransportProperties.Authenticator ntlmAuthentication = new
> HttpTransportProperties.Authenticator();
> 
> ntlmAuthentication.setAuthSchemes(authSchema);
> 
> ntlmAuthentication.setUsername(userName);
> ntlmAuthentication.setPassword(password);
> ntlmAuthentication.setHost(host);
> ntlmAuthentication.setDomain(domain);
> 
> ntlmAuthentication.setPreemptiveAuthentication(false);
> 
> Options options = new Options();
> 
> options.setProperty(HTTPConstants.CHUNKED, "false");
> options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, "false");
> 
> 
> options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
> ntlmAuthentication);
> rs._getServiceClient().setOptions(options);
> 
> }
> ...................
> -- 
> View this message in context: http://old.nabble.com/axis2-client-how-to-disable-cache--tp27772148p27772148.html
> Sent from the Axis - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
 		 	   		  
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
http://clk.atdmt.com/GBL/go/201469228/direct/01/