Java web servis istemcilerinde basic authentication

Java web servis istemcilerinde basic authentication yapmamız icap ederse şöyle bişey oluyor:

CatalogServiceService service = new CatalogServiceService();
CatalogService port = service.getCatalogServicePort();
BindingProvider provider = (BindingProvider) port;

provider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, “user”);
provider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, “pass”);

System.out.println(port.getServiceName());

Tags: ,

Leave a Reply