org.apache.axis2.transport.http.HTTPConstants.NTLM_AUTHENTICATION,ntlmAuthentication);
try
{Service1StubspServer=
new
Service1Stub("http://test001:9998/Service.asmx");// NTLM AuthenticationList<String> authScheme =
new
ArrayList<String>();authScheme.add(HttpTransportProperties.Authenticator.
NTLM
);HttpTransportProperties.Authenticator ntlm =
new
HttpTransportProperties.Authenticator();ntlm.setAuthSchemes(authScheme);ntlm.setUsername("administrator");ntlm.setPassword("1");ntlm.setHost("test001");ntlm.setPort(9998);ntlm.setDomain("sps2007");Options options =spServer._getServiceClient().getOptions();options.setProperty(HTTPConstants.
AUTHENTICATE
, ntlm);spServer._getServiceClient().setOptions(options);}
catch
(AxisFault e) {e.printStackTrace();}// Base Authentication//HttpTransportProperties.Authenticator authenticator = newHttpTransportProperties.Authenticator();//List<String> authScheme = new ArrayList<String>();//authScheme.add(HttpTransportProperties.Authenticator.BASIC);//authenticator.setAuthSchemes(authScheme);//authenticator.setUsername("administrator");
Add a Comment