we have a requirement like as follows. We got a token from a service(while redirecting from other site to atg commerce site).On redirecting to atg commerce site in one of custom request pipelineservlet ,we call service with the token. Using that response we want to create a new user/login (if user exists). Please suggest any idea to implement this functionality.
Thanks in advance
u can write ur own customized servlet in the pipeline.
One way to implement is -
write a servlet - extends InsertableServletImpl ... insert it maybe after ProfileRequestServlet.
once u make ur webservices call u can use profileTools.createNewUser() method to create a profile nd set the user/pwd.
if u want to login call ProfileServices.login
Thankyou for ur response.
I did the same. But i am getting the error on calling createNewUser() method. Then i debug the OOTB code, I found that endOperation(request) method returns
false in createUser method.Because of this, doCreateUser () method is not invoked. So the profile item is not created. Is there any configuration required or any thing missing ? If I remove manually endOperation(request) code from OOTB createNewUser() by overriding in my layer, then I am able to create profile.
At back end i am not getting any error. But any profile is not created. Because of the endOperation(request) method. This method will return boolean value based on the following snippet .pRequest.getParameter(OPERATION_END_PARAM_NAME) != null. I checked where the parameter(wsOperationEnd) is setting in request. But i am not able to find.
String createProfileId = getProfileServices().createUser(profileAsXML); If i won't override any code, profile is not create and createProfileId became null.
did u check ur profileAsXML -> does it adhere to the format accepted by the method?
does it contain user password - it should nt be encrypted...
i had a similar req - i mapped the xml to a bean.. used the user id / pwd to create the user and set the rest of the values using the profile object..