本文整理匯總了Java中javax.xml.ws.BindingProvider.PASSWORD_PROPERTY屬性的典型用法代碼示例。如果您正苦於以下問題:Java BindingProvider.PASSWORD_PROPERTY屬性的具體用法?Java BindingProvider.PASSWORD_PROPERTY怎麽用?Java BindingProvider.PASSWORD_PROPERTY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.xml.ws.BindingProvider
的用法示例。
在下文中一共展示了BindingProvider.PASSWORD_PROPERTY屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPasswordConstant
String getPasswordConstant(Map<String, Setting> settings) {
if (isSsoMode(settings)) {
return "password";
} else {
return BindingProvider.PASSWORD_PROPERTY;
}
}
示例2: getBSSWebService
/**
* Creates a OSCM Web service with the given parameters.
*
* @param serviceClass
* the class of the Web service to be created
* @param authentication
* a <code>PasswordAuthentication</code> object specifying the
* credentials to be used for authentication
* @return the service class
* @throws ConfigurationException
* if the configuration of the platform is incorrect
* @throws MalformedURLException
* if the base URL of the OSCM configuration is malformed
*/
public static <T> T getBSSWebService(Class<T> serviceClass,
PasswordAuthentication authentication)
throws ConfigurationException, MalformedURLException {
String targetNamespace = serviceClass.getAnnotation(WebService.class)
.targetNamespace();
QName serviceQName = new QName(targetNamespace,
serviceClass.getSimpleName());
String wsdlUrl = APPlatformServiceFactory.getInstance()
.getBSSWebServiceWSDLUrl();
wsdlUrl = wsdlUrl.replace("{SERVICE}", serviceClass.getSimpleName());
String serviceUrl = APPlatformServiceFactory.getInstance()
.getBSSWebServiceUrl();
serviceUrl=serviceUrl.replace("{SERVICE}", serviceClass.getSimpleName());
Service service = Service.create(new URL(wsdlUrl), serviceQName);
boolean isSsoMode = wsdlUrl != null
&& wsdlUrl.toLowerCase().endsWith("/sts?wsdl");
String portSuffix = isSsoMode ? "PortSTS" : "PortBASIC";
T client = service.getPort(
new QName(targetNamespace, serviceClass.getSimpleName()
+ portSuffix), serviceClass);
String usernameConstant = isSsoMode ? "username"
: BindingProvider.USERNAME_PROPERTY;
String passwordConstant = isSsoMode ? "password"
: BindingProvider.PASSWORD_PROPERTY;
Map<String, Object> clientRequestContext = ((BindingProvider) client)
.getRequestContext();
clientRequestContext
.put(usernameConstant, authentication.getUserName());
clientRequestContext
.put(passwordConstant, authentication.getPassword());
clientRequestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
serviceUrl );
return client;
}