Forums

Home » Liferay Portal » English » Liferay Legacy

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
lyo li yashnoo
UserServiceSoap addUser method set passwordEncrypt to 1?
March 20, 2007 6:54 PM
Answer

lyo li yashnoo

Rank: Regular Member

Posts: 112

Join Date: November 28, 2006

Recent Posts

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
Jorge Ferrer
RE: UserServiceSoap addUser method set passwordEncrypt to 1?
March 31, 2007 9:26 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2757

Join Date: August 31, 2006

Recent Posts

That cannot be done through the API, but you can set a property in portal(-ext).properties to avoid having the user passwords encrypted:
1passwords.encrypted=false
lyo li yashnoo
RE: UserServiceSoap addUser method set passwordEncrypt to 1?
April 3, 2007 5:46 PM
Answer

lyo li yashnoo

Rank: Regular Member

Posts: 112

Join Date: November 28, 2006

Recent Posts

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:
1passwords.encrypted=false


Thank you! I do it in this way and no problem. emoticon
praveen kumar
RE: UserServiceSoap addUser method set passwordEncrypt to 1?
March 22, 2010 11:50 PM
Answer

praveen kumar

Rank: New Member

Posts: 3

Join Date: March 19, 2010

Recent Posts

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.");
}
}

Antoine Comble
RE: UserServiceSoap addUser method set passwordEncrypt to 1?
February 14, 2013 8:27 AM
Answer

Antoine Comble

Rank: Regular Member

Posts: 210

Join Date: September 7, 2012

Recent Posts

Hi,

Just replace ENGLISH by en_EN.