Buenas tardes a todos,
Alguien sabe cómo crear una cuenta con SOAP API?
Dicen que es mejor con SOAP API en lugar de SoapProvisioning,
viewtopic.php?t=2996
no sé por qué, estoy intentando hacer con SOAP API, pero me da error
Estoy tomando como referencia el siguiente link:
viewtopic.php?t=1842
Se me cae en la línea
response = trans.invoke(request);
La excepción es la siguiente:
com.zimbra.common.soap.SoapFaultException: authentication failed for []
ExceptionId:qtp998351292-84540:1529083695580:7903f8c2b011342a
Code:account.AUTH_FAILED
¿Cómo podré resolver?
SoapHttpTransport trans = null;
Element response = null;
Element request = null;
try {
trans = new SoapHttpTransport("https://192.168.248.129:7071" + com.zimbra.common.soap.AdminConstants.ADMIN_SERVICE_URI);
//SoapHTTPTransport(uri=https://192.168.248.129:7071/service/admin/soap/)
//Element request = Element.XMLElement.mFactory.createElement("AdminService.AuthRequest");
request = Element.XMLElement.mFactory.createElement(AccountConstants.AUTH_REQUEST);
request.addAttribute("AdminService.name","admin@localdomain",Element.Disposition.CONTENT);
request.addAttribute("AdminService.password", "123456",Element.Disposition.CONTENT);
/*
<AuthRequest xmlns="urn:zimbraAccount">
<AdminService.name>admin@localdomain</AdminService.name>
<AdminService.password>123456</AdminService.password>
</AuthRequest>
*/
System.out.println(request.toString());
response = trans.invoke(request);
} catch (Exception e) {
e.printStackTrace();
}
Como crear cuenta desde aplicacion con SOAP API
Re: Como crear cuenta desde aplicacion con SOAP API
La línea de a continuación no compila:
String sessionId = response.getAttribute(ZimbraSoapContext.E_SESSION_ID, null);
La tomé como referencia de los siguientes links:
https://wiki.zimbra.com/wiki/ZClient
viewtopic.php?t=2444
Sale el error:
E_SESSION_ID cannot be resolved or is not a field
String sessionId = response.getAttribute(ZimbraSoapContext.E_SESSION_ID, null);
La tomé como referencia de los siguientes links:
https://wiki.zimbra.com/wiki/ZClient
viewtopic.php?t=2444
Sale el error:
E_SESSION_ID cannot be resolved or is not a field
Re: Como crear cuenta desde aplicacion con SOAP API
Las siguientes lineas con cuáles se reemplazaron?
String sessionId = response.getAttribute(AccountConstants.SESSION_ID, null);
Element accRequest = Element.XMLElement.mFactory.createElement(AccountConstants.CREATE_ACCOUNT_REQUEST);
accRequest.addElement(AccountConstants.E_NAME).setText("test@example.com");
accRequest.addElement(AccountConstants.E_PASSWORD).setText("examplepasswd");
String sessionId = response.getAttribute(AccountConstants.SESSION_ID, null);
Element accRequest = Element.XMLElement.mFactory.createElement(AccountConstants.CREATE_ACCOUNT_REQUEST);
accRequest.addElement(AccountConstants.E_NAME).setText("test@example.com");
accRequest.addElement(AccountConstants.E_PASSWORD).setText("examplepasswd");
- Attachments
-
- deprecated.jpg (108.45 KiB) Viewed 2287 times