Foren

UserServiceSoap addUser method set passwordEncrypt to 1?

thumbnail
lyo li yashnoo, geändert vor 17 Jahren.

UserServiceSoap addUser method set passwordEncrypt to 1?

Regular Member Beiträge: 112 Beitrittsdatum: 29.11.06 Neueste Beiträge
Hi friends:

I add a portal user by using method "UserServiceSoap.addUser(...)" method,But I find that the passwordEncrypt column is set to "1" automatically.It's not what I want. I mean that I want to add a user add set the passwordEncrypt to "0".There is not passwordEncrypt parameter in "addUser(...)" method.emoticon If I don't want to change liferay code,how to do it? Thks
thumbnail
Jorge Ferrer, geändert vor 17 Jahren.

RE: UserServiceSoap addUser method set passwordEncrypt to 1?

Liferay Legend Beiträge: 2871 Beitrittsdatum: 31.08.06 Neueste Beiträge
That cannot be done through the API, but you can set a property in portal(-ext).properties to avoid having the user passwords encrypted:
passwords.encrypted=false
thumbnail
lyo li yashnoo, geändert vor 17 Jahren.

RE: UserServiceSoap addUser method set passwordEncrypt to 1?

Regular Member Beiträge: 112 Beitrittsdatum: 29.11.06 Neueste Beiträge
Jorge Ferrer:
That cannot be done through the API, but you can set a property in portal(-ext).properties to avoid having the user passwords encrypted:
passwords.encrypted=false


Thank you! I do it in this way and no problem. emoticon
praveen kumar, geändert vor 14 Jahren.

RE: UserServiceSoap addUser method set passwordEncrypt to 1?

New Member Beiträge: 3 Beitrittsdatum: 19.03.10 Neueste Beiträge
hi ,

any one could help me, how to call UserService and add new user in to liferay database.

i have tried but i got the following error. With this i have attached my code also for you reference ...

Error : AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.rmi.RemoteException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:lab93

java.rmi.RemoteException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.ja

Mycode : /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package com.liferay.portal.events;

/**
*
* @author kumar.ganapathy
*/
import java.net.URL;

import com.liferay.client.soap.portal.model.UserSoap;
import com.liferay.client.soap.portal.service.ServiceContext;
import com.liferay.client.soap.portal.service.http.GroupServiceSoap;
import com.liferay.client.soap.portal.service.http.GroupServiceSoapServiceLocator;
import com.liferay.client.soap.portal.service.http.UserServiceSoap;
import com.liferay.client.soap.portal.service.http.UserServiceSoapServiceLocator;
import java.io.Serializable;
import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;

public class SampleWSClient1 implements Serializable , DeserializerFactory
{
public static void main(String[] args)
{
try
{
long creatorUserId = 0;
boolean autoPassword = false;
boolean autoScreenName = false;
String openId = "";
java.util.Locale locale = new java.util.Locale("en_US");
String middleName = "";
int prefixId = 0;
int suffixId = 0;
int birthdayMonth = 3;
int birthdayDay = 23;
int birthdayYear = 1985;
String jobTitle = "";
//long[] groupIds = null;
long[] organizationIds = null;
long[] roleIds = null;
long[] userGroupIds = null;
boolean sendEmail = false;
ServiceContext serviceContext = new ServiceContext();
String remoteUser = "test";
String password = "test";
String screenName="praveekan";
String emailAddress="pravee@liferay.com";
String password1="password";
String firstName="pravee";
String lastName="kan";
long[] groupIds = null;

// UserServiceSoapServiceLocator locator = new UserServiceSoapServiceLocator("http://10.1.11.93:9000/tunnel-web/axis/Portal_UserService?wsdl", new QName("Portal_UserService"));
UserServiceSoapServiceLocator locator = new UserServiceSoapServiceLocator();
UserServiceSoap soap = locator.getPortal_UserService(_getURL("12721", "Portal_UserService"));

UserSoap usoap= soap.addUser(10112, autoPassword,password1,password1,autoScreenName,screenName,emailAddress,openId,"ENGLISH",firstName,middleName,lastName,prefixId,suffixId, true,birthdayMonth,birthdayDay,birthdayYear, jobTitle, groupIds,organizationIds,roleIds,userGroupIds, sendEmail,new ServiceContext());

long[] uid={usoap.getUserId()};
System.out.println("uid : "+uid[0]);
soap.addUserGroupUsers(14502, uid);
}
catch (Exception e)
{
// TODO Auto-generated catch block
System.out.println("error message : "+e.getMessage());
e.printStackTrace();
}


}


public static URL _getURL(String userIdAsString, String serviceName) throws Exception {

// Unathenticated url

String url = "http://10.1.11.93:9000/tunnel-web/axis/" + serviceName;

// Authenticated url

if (false) {


url = "http://15730:password@10.1.11.93:9000/tunnel-web/axis/" + serviceName;
// url = "http://10.1.11.93:9000/tunnel-web/axis/" + serviceName;
}
System.out.println(url);
return new URL(url);
}

public Deserializer getDeserializerAs(String string) {
throw new UnsupportedOperationException("Not supported yet.");
}

public Iterator getSupportedMechanismTypes() {
throw new UnsupportedOperationException("Not supported yet.");
}
}

thumbnail
Antoine Comble, geändert vor 11 Jahren.

RE: UserServiceSoap addUser method set passwordEncrypt to 1?

Regular Member Beiträge: 232 Beitrittsdatum: 07.09.12 Neueste Beiträge
Hi,

Just replace ENGLISH by en_EN.