tags:

views:

378

answers:

0

I am working on a J2EE client (1.4 JVM) that needs to consume a NTLM secured web service. We run our J2EE applications on Weblogic (8.1.4 in this case) on Windows which in turn runs under an NT service account. In the past, we have used the Weblogic clientgen capability to generate the client stub and handle the connections. This works great and is able to by default pull the default credential of the running process and use that to authenticate against the web service.

Due to WAN performance we now have the need to send gzip headers to the web service such that the response comes back compressed. It does not appear the Weblogic clientgen process supports gzip, so I have switched to Axis2 (1.4.1) to assist with the client stub and connections. The headers are now sent, but I have not been able to figure out how (or whether) Axis2 can pull default credentials from the running process, opposed to having them in plain view somewhere in the application package. Is this possible? If not, is there a way to supply encrypted credentials to the Axis2 client?

I'm not married to Axis2, if another web service client library meets my needs (supports gzipped responses and NTLM security, pulling the credentials from the running process), I can switch. Below is the pseudo-code as-is that sets up the request and its security.

ProductSearchStub stub = new ProductSearchStub("http://myserver.mycompany.com:12345/webservices/ProductSearch");

stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);            
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);

HttpTransportProperties.Authenticator
auth = new HttpTransportProperties.Authenticator();
auth.setUsername("username");
auth.setPassword("plaintextpassword");
auth.setDomain("mydomain");
auth.setHost("myserver.mycompany.com");
auth.setPort(12345);

stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, auth);

...make web service call