Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-2009, 07:31 AM
Starter Member
 
Posts: 1
Default Authenticating with ZMailbox

Hi!

I'm trying to use the ZMailbox class to connect to Zimbra, but I'm facing problems already at authentication. I'm using Jython, but I guess this applies to the zimbra classes in general. I've tried different urls for connecting (port 7071, path "/service/admin/soap", trailing slash), with no luck.

I'm probably doing some very simple mistake, but I've been unable to get past this so far.

This test snippet:

Code:
from com.zimbra.cs.account.Provisioning import AccountBy
from com.zimbra.cs.zclient import ZMailbox

opt = ZMailbox.Options()
opt.setAccount("username")
opt.setPassword("password")
opt.setAccountBy(AccountBy.name)
opt.setUri("https://exampleserver/service/soap")
mb = ZMailbox.getMailbox(opt)
results in this error:
Code:
Traceback (most recent call last):
  File "test2.py", line 10, in <module>
    mb = ZMailbox.getMailbox(opt)
ExceptionId:main:1256045363781:6acbc37c5772b034
Code:service.INVALID_REQUEST
        at com.zimbra.common.service.ServiceException.INVALID_REQUEST(ServiceExc
eption.java:258)
        at com.zimbra.common.soap.Element.checkNull(Element.java:243)
        at com.zimbra.common.soap.Element.getElement(Element.java:170)
        at com.zimbra.cs.zclient.ZAuthResult.<init>(ZAuthResult.java:37)
        at com.zimbra.cs.zclient.ZMailbox.authByPassword(ZMailbox.java:506)
        at com.zimbra.cs.zclient.ZMailbox.<init>(ZMailbox.java:415)
        at com.zimbra.cs.zclient.ZMailbox.getMailbox(ZMailbox.java:352)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)

com.zimbra.common.service.ServiceException: com.zimbra.common.service.ServiceExc
eption: invalid request: missing required element: authToken
ExceptionId:main:1256045363781:6acbc37c5772b034
Code:service.INVALID_REQUEST
Any kind of help/tip would be much appreciated.
Reply With Quote
  #2 (permalink)  
Old 11-27-2009, 12:12 AM
Starter Member
 
Posts: 2
Default Autheenticating with ZMailbox

Kangis,
You need to specify the kind of request you perform. In this case something like GET_ADMINAUTH_REQUEST
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.