コード例 #1
0
 /**
  * Verifies the credentials
  *
  * @param username
  * @param password
  * @return
  * @throws NoSuchAlgorithmException
  * @throws XmlPullParserException
  * @throws IOException
  */
 public boolean VerifyCredentials(UserCredentials credentials) throws CWException {
   Boolean verified;
   try {
     verified =
         SoapPrimitiveToBoolean(
             (SoapPrimitive)
                 PerformSOAPCall(
                     "VerifyCredentials",
                     new PropertyInfo[] {
                       CreatePrimitivePropertyInfo("username", credentials.getUsername()),
                       CreatePrimitivePropertyInfo(
                           "passwordhash", HashUtils.HashPassword(credentials.getPassword())),
                       CreatePrimitivePropertyInfo("control", "CWRocks2008")
                     },
                     null
                     /*new IEnvelopeSetupCallback(){
                     	@Override
                     	public void Setup(SoapSerializationEnvelope env) {
                     		new MarshalBoolean(_namespace, "VerifyCredentialsResponse", 1).register(env);
                     	}
                     }*/ ));
     return verified;
   } catch (Exception e) {
     e.printStackTrace();
     throw new CWException(e.getMessage());
   }
 }