Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/316.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
Java 认证和确认码_Java_Web Services_Axis2 - Fatal编程技术网

Java 认证和确认码

Java 认证和确认码,java,web-services,axis2,Java,Web Services,Axis2,这是一个Web服务代码。我将使用自下而上的方法从下面的代码生成WSDL,并使用ApacheAxis2 codeGenerator发布它。我正在编写检查用户名和密码的JAVA代码。一旦用户名和密码通过身份验证,那么我的代码应该检查唯一ID是否为整数且不为零,然后它将检查解析是否已解析。如果uniqueID和resolution为true,那么我的代码应该返回true作为确认 我尝试了下面的JAVA代码,但它不是完全正确的,也不能达到预期的结果。请任何人帮助我更正我的AuthMain类以成功生成WS

这是一个Web服务代码。我将使用自下而上的方法从下面的代码生成WSDL,并使用ApacheAxis2 codeGenerator发布它。我正在编写检查用户名和密码的JAVA代码。一旦用户名和密码通过身份验证,那么我的代码应该检查唯一ID是否为整数且不为零,然后它将检查解析是否已解析。如果uniqueID和resolution为true,那么我的代码应该返回true作为确认

我尝试了下面的JAVA代码,但它不是完全正确的,也不能达到预期的结果。请任何人帮助我更正我的AuthMain类以成功生成WSDL。非常感谢。我尽力解释这个问题。如果我遗漏了描述中的任何一点,请让我知道,而不是标记为否定,有时它往往会发生,即使我不想遗漏任何一点

AuthMain类

public class AuthMain {


/**
 * @param args
 */

// TODO Auto-generated method stub
Authenticate au = new Authenticate();

String resolution = null;
int bizId =0;

public boolean validateState() {
    if(resolution.equalsIgnoreCase("Resolved"))
    {
        return true;
    }
    else
    {
        System.out.println("Invalid State information");
        return false;
    }
}
    public boolean validateId()
    {

        if(bizId==0)
        {
            System.out.println("Invalid bizflow ID");
            return false;
        }
        else
        {
            return true;
        }
    }


}
下面是我的Authenticate.JAVA

public class Authenticate {

private  String password;
private String userName;


public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public String getUserName() {
return userName;
}

public void setUserName(String userName) {
this.userName = userName;
}

public boolean userValidation()
 {
 if(userName.equals("UserName@123"))
 {
     return true;
 }
 else
 {
System.out.println("Invalid User Name");
     return false;
 }
}

public boolean passwordValidation()
{
if(password.equals("Password@123"))
{
    return true;
}
else
{
    System.out.println("Invalid Password");
return false;
}
 }

 }

我建议,不要使用selfwirtten身份验证,没有理由编写自己的securityfeature

例如,如果您使用JBoss,您可以添加带有简单注释的loginmechanism

添加注释,添加带有首选登录模块的SecurityDomain,最终添加一些SSL/TSL
=>完成

什么不能达到预期的结果?写下一些输入,并具体说明接下来会发生什么。我正在使用Tomcate。有没有使用ApacheAxis2编写的这样的代码。