當前位置: 首頁>>代碼示例>>Java>>正文


Java BindingProvider.PASSWORD_PROPERTY屬性代碼示例

本文整理匯總了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;
    }

}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:8,代碼來源:BesDAO.java

示例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;
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:54,代碼來源:BSSWebServiceFactory.java


注:本文中的javax.xml.ws.BindingProvider.PASSWORD_PROPERTY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。