You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sumit Pathak <su...@gmail.com> on 2013/09/03 07:01:24 UTC

cxf NTLM authentication

I am working on calling a NTLM secure web service, I am using cxf 2.3.2 and
java 1.6.
I wrote a standalone client and it just work fine, when I am running that
code in Jboss, I am only able to call the web service one, all subsequent
calls just fail.
When I did wireshark I can see that during first call cxf tries to download
the wsdl and NTLM authentication took place, but I all subsequent calls, it
doesn't try to download the wsdl and calls the service method and just fails
Below is my code.

 try
    {
    
    templateManagerServicePort = templateManagerService
      .getBasicHttpBindingTemplateManagerServiceSoap();
    Client client = ClientProxy.getClient(templateManagerServicePort);
    Bus bus = ((EndpointImpl) client.getEndpoint()).getBus();
    client.getInInterceptors().add(new LoggingInInterceptor());
    client.getOutInterceptors().add(new LoggingOutInterceptor());
    PolicyInterceptorProviderRegistry pipr = bus
      .getExtension(PolicyInterceptorProviderRegistry.class);
    pipr.register(new XRMNTLMPolicyProvider());
    HTTPConduit http = (HTTPConduit) client.getConduit();
    AuthorizationPolicy policy = new AuthorizationPolicy();
    policy.setUserName(XpertDocDocumentGenerationStrategy.USER_NAME);
    policy.setPassword(XpertDocDocumentGenerationStrategy.PASSWORD);
    http.setAuthorization(policy);
    HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
    httpClientPolicy.setConnectionTimeout(30000);
    httpClientPolicy.setAllowChunking(false);
    http.setClient(httpClientPolicy);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }

Can somebody please help this is very important for a major project
deadline, do let me know if more information is needed.



--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-NTLM-authentication-tp5733426.html
Sent from the cxf-user mailing list archive at Nabble.com.