Hi Abraham, Can you make sure you are using the right values for the following parameters?
AppServiceBean.account = A valid full admin email address (e.g. [EMAIL PROTECTED]) AppServiceBean.domain = yourdomain Also, please make sure you code reuse the Auth token to avoid CAPTCHA exceptions. The token is valid for 24 hours. To learn more about CAPTCHA, please visit: http://code.google.com/apis/apps/faq.html#captcha Thanks, --Tony On Nov 24, 10:24 am, "Abraham Segura" <[EMAIL PROTECTED]> wrote: > Esto fue lo que me salio de resultado > Método devueltojava.lang.String : "*Error: Invalid credentials*" > ------------------------------ > Solicitud SOAP > ------------------------------ > > <?xml version="1.0" encoding="UTF-8"?> > <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> > <S:Header/> > <S:Body> > <ns2:createUser xmlns:ns2="http://ejb.gapps.kionetworks.com/"> > <givenName>Abraham</givenName> > <familyName>Abraham</familyName> > </ns2:createUser> > </S:Body> > </S:Envelope> > > ------------------------------ > Respuesta SOAP > ------------------------------ > > <?xml version="1.0" encoding="UTF-8"?> > <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> > <S:Body> > <ns2:createUserResponse xmlns:ns2="http://ejb.gapps.kionetworks.com/"> > <return>Error: Invalid credentials</return> > </ns2:createUserResponse> > </S:Body> > </S:Envelope> > > On Mon, Nov 24, 2008 at 12:16 PM, Abraham Segura > <[EMAIL PROTECTED]>wrote: > > > Ok voy a probar y te digo los resultados. > > > On Mon, Nov 24, 2008 at 12:13 PM, Julian (Google) <[EMAIL PROTECTED]> wrote: > > >> Por tu código, imagino que estas llamando al método createUser, con el > >> username en Null, ¿Podrías mostrarme la llamada a createUser? > > >> Podrías utilizar el código de esta forma, asignando el username al > >> principio, no te recomiendo dejar "catch(Exception ex){}" vacia, > >> porque no puedes ver si occurren errores en la llamada a la API. > > >> @WebMethod(operationName = "createUser") > >> public String createUser(@WebParam(name = "givenName") > >> String givenName, @WebParam(name = "familyName") > >> String familyName){ > >> //TODO write your implementation code here: > >> try > >> { > > >> String username = givenName.toLowerCase().substring(0, 1) > >> + familyName.toLowerCase()+IDGenerator.getId(); > > >> AppsForYourDomainClient apps = new AppsForYourDomainClient > >> ( > >> AppServiceBean.account, AppServiceBean.domain, > >> AppServiceBean.password); > >> apps.createUser(username, givenName, familyName, > >> PasswordGenerator.getPassword( > >> PasswordGenerator.MINUSCULAS+ > >> PasswordGenerator.MAYUSCULAS+ > >> PasswordGenerator.NUMEROS,10), > >> IDGenerator.getId( > >> IDGenerator.NUMEROS,5)); > >> CheckUser.userExists(apps, givenName); > >> } > >> catch(Exception ex){ > >> return "Error: " + ex.getMessage(); > >> } > >> String u = givenName +" "+ familyName; > >> return u +"Tu usuario es:"+" "+ username +" "+ "tu password > >> es:" +" "+ PasswordGenerator.getPassword(); > >> } > > >> On Nov 24, 5:52 pm, "Abraham Segura" <[EMAIL PROTECTED]> wrote: > >> > Este es el codigo con el que genero todo > > >> > @WebMethod(operationName = "createUser") > >> > public String createUser(@WebParam(name = "username") > >> > String username,@WebParam(name = "givenName") > >> > String givenName, @WebParam(name = "familyName") > >> > String familyName){ > >> > //TODO write your implementation code here: > >> > try > >> > { > >> > AppsForYourDomainClient apps = new > >> > AppsForYourDomainClient(AppServiceBean.account, > >> > AppServiceBean.domain, AppServiceBean.password); > >> > apps.createUser(username, givenName, familyName, > >> > PasswordGenerator.getPassword( > >> > PasswordGenerator.MINUSCULAS+ > >> > PasswordGenerator.MAYUSCULAS+ > >> > PasswordGenerator.NUMEROS,10), > >> > IDGenerator.getId( > >> > IDGenerator.NUMEROS,5)); > >> > CheckUser.userExists(apps, givenName); > >> > } > >> > catch(Exception ex){} > >> > String u = givenName +" "+ familyName; > >> > return u +"Tu usuario es:"+" "+ (username = > >> > givenName.toLowerCase().substring(0, 1) + > >> > familyName.toLowerCase()+IDGenerator.getId()) +" "+ "tu password es:" +" > >> "+ > >> > PasswordGenerator.getPassword(); > >> > } > > >> > Uso el netbeans, para hacer esto, si necesitas algo mas me avisas por > >> favor. > > >> > Gracias, Saludos > > >> > 2008/11/24 Julian (Google) <[EMAIL PROTECTED]> > > >> > > ¿Podrías mostrarme el código Java que utilizas para generar la llamada > >> > > SOAP? ¿Qué framework SOAP estás utilizando? > > >> > > Si, username es un valor reservado del framework, siempre podrías > >> > > utilizar otro nombre para ese parámetro. > > >> > > Saludos, > >> > > Julián > > >> > > On Nov 24, 3:00 pm, "Abraham Segura" <[EMAIL PROTECTED]> > >> wrote: > >> > > > Ok, muchas gracias Julian. > > >> > > > Lo que pasa es que estoy creando el usuario de forma automatica como > >> lo > >> > > ves, > >> > > > y cuando genero el XML, username no toma ningun valor y lo necesito > >> para > >> > > > poder generar el usuario, mi cuanta en google apps por lo que veo, > >> te > >> > > pongo > >> > > > el xml para que veas. > > >> > > > Método devueltojava.lang.String : "*Abraham SeguraTu usuario es: > >> > > asegura37 > >> > > > tu password es: cFIhSfSN*" > >> > > > ------------------------------ > >> > > > Solicitud SOAP > >> > > > ------------------------------ > > >> > > > <?xml version="1.0" encoding="UTF-8"?> > >> > > > <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> > >> > > > <S:Header/> > >> > > > <S:Body> > >> > > > <ns2:createUser xmlns:ns2="http://ejb.gapps.kionetworks.com/"> > >> > > > <givenName>Abraham</givenName> > >> > > > <familyName>Segura</familyName> > >> > > > </ns2:createUser> > >> > > > </S:Body> > >> > > > </S:Envelope> > > >> > > > ------------------------------ > >> > > > Respuesta SOAP > >> > > > ------------------------------ > > >> > > > <?xml version="1.0" encoding="UTF-8"?> > >> > > > <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> > >> > > > <S:Body> > >> > > > <ns2:createUserResponse xmlns:ns2=" > >>http://ejb.gapps.kionetworks.com/"> > >> > > > <return>Abraham SeguraTu usuario es: asegura37 tu password es: > >> > > cFIhSfSN</return> > >> > > > </ns2:createUserResponse> > >> > > > </S:Body> > >> > > > </S:Envelope> > > >> > > > y lo que necesito es en la solicitud SOAP crear el username para que > >> que > >> > > se > >> > > > genere bien la cuenta., se podra hacer algo. > > >> > > > Regards > > >> > > > On Mon, Nov 24, 2008 at 8:35 AM, Julian (Google) <[EMAIL PROTECTED]> > >> > > wrote: > > >> > > > > Hi Abraham, > > >> > > > > I don't understand clearly your problem, What is the problem with > >> > > > > username? this parameter is needed for apps.createUser. > > >> > > > > (Puedes escribir el problema en Español, si crees que sería más > >> fácil > >> > > > > explicarlo) > > >> > > > > Cheers, > >> > > > > Julian > > >> > > > > On Nov 23, 6:11 pm, "Abraham Segura" <[EMAIL PROTECTED]> > >> wrote: > >> > > > > > Hi group i need your help, i am trying to create a user, but i > >> have a > >> > > > > > problem i need to generate automatic, but i can´t give to ma > >> variable > >> > > * > >> > > > > > username* to take the value of this i dont know where to put it, > >> if > >> > > > > anyone > >> > > > > > could help me, will me so happy, I put my code so you can see: > > >> > > > > > @WebMethod(operationName = "createUser") > >> > > > > > public String createUser(@WebParam(name = "username") > >> > > > > > String username,@WebParam(name = "givenName") > >> > > > > > String givenName, @WebParam(name = "familyName") > >> > > > > > String familyName){ > >> > > > > > //TODO write your implementation code here: > >> > > > > > try > >> > > > > > { > >> > > > > > AppsForYourDomainClient apps = new > >> > > > > > AppsForYourDomainClient(AppServiceBean.account, > >> > > AppServiceBean.domain, > >> > > > > > AppServiceBean.password); > >> > > > > > apps.createUser(username, givenName, familyName, > >> > > > > > PasswordGenerator.getPassword( > >> > > > > > PasswordGenerator.MINUSCULAS+ > >> > > > > > PasswordGenerator.MAYUSCULAS+ > >> > > > > > PasswordGenerator.NUMEROS,10), > >> > > > > > IDGenerator.getId( > >> > > > > > IDGenerator.NUMEROS,5)); > >> > > > > > CheckUser.userExists(apps, givenName); > >> > > > > > } > >> > > > > > catch(Exception ex){} > >> > > > > > String u = givenName +" "+ familyName; > >> > > > > > return u +"Tu usuario es:"+" "+ (username = > >> > > > > > givenName.toLowerCase().substring(0, 1) + > >> > > > > > familyName.toLowerCase()+IDGenerator.getId()) +" "+ "tu password > >> es:" > >> > > +" > >> > > > > "+ > >> > > > > > PasswordGenerator.getPassword(); > >> > > > > > } > > >> > > > > > Regards. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Apps APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-apps-apis?hl=en -~----------~----~----~----~------~----~------~--~---
