Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/381.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用JavaScript的消费者Web服务_Javascript_Java_Ajax_Spring_Web Services - Fatal编程技术网

使用JavaScript的消费者Web服务

使用JavaScript的消费者Web服务,javascript,java,ajax,spring,web-services,Javascript,Java,Ajax,Spring,Web Services,我正在尝试验证历史记录中的密码,该应用程序是用Java和Spring开发的,我的疑问是在恢复历史记录和比较我输入的密码时 我试图通过Ajax调用WebService密码来实现这一点,但在URL(我知道我必须输入WebService的名称)和数据中,我不知道输入什么(密码值?)。该函数称为isValidPassword 您可以在其中找到服务和方法的Java类: @WebService(targetNamespace = "urn:idm.openiam.org/srvc/pswd/ser

我正在尝试验证历史记录中的密码,该应用程序是用Java和Spring开发的,我的疑问是在恢复历史记录和比较我输入的密码时

我试图通过Ajax调用WebService密码来实现这一点,但在URL(我知道我必须输入WebService的名称)和数据中,我不知道输入什么(密码值?)。该函数称为isValidPassword

您可以在其中找到服务和方法的Java类:

@WebService(targetNamespace = "urn:idm.openiam.org/srvc/pswd/service", name = "PasswordWebService")
    @XmlSeeAlso({ObjectFactory.class})
    public interface PasswordWebService {
     @WebMethod
        @RequestWrapper(localName = "isPasswordValid", targetNamespace = "urn:idm.openiam.org/srvc/pswd/service", className = "es.sanitas.gid.client.meta.IsPasswordValid")
        @ResponseWrapper(localName = "isPasswordValidResponse", targetNamespace = "urn:idm.openiam.org/srvc/pswd/service", className = "es.sanitas.gid.client.meta.IsPasswordValidResponse")
        @WebResult(name = "return", targetNamespace = "")
        public es.sanitas.gid.client.meta.PasswordValidationResponse isPasswordValid(
            @WebParam(name = "pswd", targetNamespace = "")
            es.sanitas.gid.client.meta.Password pswd
        );
    }
   $(document).ready(function() {  
        //var pswd=0
        var confpswd=0
        var minLength="La contraseña debe tener al menos 12 caracteres"
        var pwdEquals="Las contraseñas deben coincidir"
        var checkHistoryPass="Su contraseña es válida y no se ha usado anteriormente"
        
        $('#newPassword').keyup(function() {
            pswd = $(this).val();
            checkAllRules(pswd);
            checkEquals(pswd,confpswd);
            isValidPassword(pswd,confpswd)
            enabledButton();
        }); 
    
        $('#newPasswordConfirm').keyup(function() {
            confpswd = $(this).val();
            checkAllRules(pswd,confpswd);
            checkEquals(pswd,confpswd);
            isValidPassword(pswd,confpswd)
            enabledButton();
        });

    function isValidPassword(pswd, conf){       
        $.ajax({
          url: "PasswordWebService",
          data: pswd,
          type: "POST",
          dataType: "json",
          contentType: "application/json",
          success: function(data) { 
              console.log("SUCCESS: ", data);
              },
        
        error : function(e) {
            console.log("ERROR: ", e);
        },
        done : function(e) {
            console.log("DONE");
        }
        });     
}
Javascript,其中包含要验证的规则:

@WebService(targetNamespace = "urn:idm.openiam.org/srvc/pswd/service", name = "PasswordWebService")
    @XmlSeeAlso({ObjectFactory.class})
    public interface PasswordWebService {
     @WebMethod
        @RequestWrapper(localName = "isPasswordValid", targetNamespace = "urn:idm.openiam.org/srvc/pswd/service", className = "es.sanitas.gid.client.meta.IsPasswordValid")
        @ResponseWrapper(localName = "isPasswordValidResponse", targetNamespace = "urn:idm.openiam.org/srvc/pswd/service", className = "es.sanitas.gid.client.meta.IsPasswordValidResponse")
        @WebResult(name = "return", targetNamespace = "")
        public es.sanitas.gid.client.meta.PasswordValidationResponse isPasswordValid(
            @WebParam(name = "pswd", targetNamespace = "")
            es.sanitas.gid.client.meta.Password pswd
        );
    }
   $(document).ready(function() {  
        //var pswd=0
        var confpswd=0
        var minLength="La contraseña debe tener al menos 12 caracteres"
        var pwdEquals="Las contraseñas deben coincidir"
        var checkHistoryPass="Su contraseña es válida y no se ha usado anteriormente"
        
        $('#newPassword').keyup(function() {
            pswd = $(this).val();
            checkAllRules(pswd);
            checkEquals(pswd,confpswd);
            isValidPassword(pswd,confpswd)
            enabledButton();
        }); 
    
        $('#newPasswordConfirm').keyup(function() {
            confpswd = $(this).val();
            checkAllRules(pswd,confpswd);
            checkEquals(pswd,confpswd);
            isValidPassword(pswd,confpswd)
            enabledButton();
        });

    function isValidPassword(pswd, conf){       
        $.ajax({
          url: "PasswordWebService",
          data: pswd,
          type: "POST",
          dataType: "json",
          contentType: "application/json",
          success: function(data) { 
              console.log("SUCCESS: ", data);
              },
        
        error : function(e) {
            console.log("ERROR: ", e);
        },
        done : function(e) {
            console.log("DONE");
        }
        });     
}