Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 35

Thread: How to consume zimbra SOAP API in my java application

  1. #21
    abhishek_agl is offline Member
    Join Date
    Nov 2006
    Location
    NOIDA, India
    Posts
    13
    Rep Power
    8

    Default accessing mails

    Hi Sam
    Thanks for the invaluable input

    One question:

    From web browser, if I have to perform admin tasks, I log-in to https://server:7071/zimbraAdmin

    But if I simply want to check a user's account (say I just want to check my mails, and I am not an admin), then I go to http://server/

    That is, i don't have to go thru SSL (https).
    Does this hold true for web services as well. That is, if I want my web service client to simply retrieve all mails from my (non-admin user's) inbox, do I still need to hit the https url? Or is there some http URL over which web services are exposed?
    Diamond is a piece of coal that performed well under pressure

  2. #22
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default SOAP URLs

    Bugzilla - Wiki - Downloads - Before posting... Search!

  3. #23
    seeker is offline Intermediate Member
    Join Date
    Nov 2006
    Posts
    19
    Rep Power
    8

    Default

    New problem about using Java and Zimbra SOAP API.

    Of course Im useing java.io.BufferedReader to read response from Zimbra.

    If the response from Zimbra is a failure such as "authentication failed (HTTP/1.1 500 Internal Server Error)" I have no problem reading the response using .readLine() or .read() methods of java.io.BufferedReader. I put readLine() in a loop, read the response, line by line until it returns NULL which means its the end of the stream (the response).

    Here is the problem, if the response is a success such as a successful authentication (HTTP/1.1 200 OK which gives me the sessionId,...) the readLine() never returns NULL, it seems it doesnt know where the response ends and waits for zimbra server to give more although it has received the entire response. I know that because I flush the buffer after readying each line and I do see the entire body.

    Any idea?

  4. #24
    abhishek_agl is offline Member
    Join Date
    Nov 2006
    Location
    NOIDA, India
    Posts
    13
    Rep Power
    8

    Default DKarp (RE: SOAP URLs )

    Hi Dan.
    As we have the following SOAP packet for admin (provided by Sam at the begining of this thread):

    <
    soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">

    <soap:Header>

    <context xmlns="urn:zimbra">

    <nonotify />

    <noqualify />

    </context>

    </soap:Header>

    <soap:Body>

    <AuthRequest xmlns="urn:zimbraAdmin">

    <name>admin@myCompany.com</name>

    <password>mypassword</password>

    </AuthRequest>

    </soap:Body>

    </
    soap:Envelope>

    What shall be the packet for getting the e-mails of a non-admin user (that is, what shall I send to http://server/service/soap to retrieve the, mails of an end-user)?
    Is there any sample code and xml which I can refer? Soap.txt gives generic formats and envelopes, no concrete exapmle.
    Diamond is a piece of coal that performed well under pressure

  5. #25
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default Making it hard on yourself

    Quote Originally Posted by seeker View Post
    Of course Im useing java.io.BufferedReader to read response from Zimbra.
    Dealing with the business logic is tricky enough. Why write an XML parser as well? Just feed the InputStream from the HTTP response into the XML parser of your choice and all these issues should magically disappear.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  6. #26
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default Easiest way is debug mode

    Quote Originally Posted by abhishek_agl View Post
    What shall be the packet for getting the e-mails of a non-admin user (that is, what shall I send to http://server/service/soap to retrieve the, mails of an end-user)?
    Is there any sample code and xml which I can refer? Soap.txt gives generic formats and envelopes, no concrete exapmle.
    Open your web browser and go to Zimbra with the debug window turned on. (Do a search in the forums to figure out how to do this.) While you use the app, you can watch the SOAP requests fly by.

    Note that the responses come back in JSON because the requests ask for "js"-formatted requests; if you leave that element out of the header you'll get back the same format you send the server.

    And soap.txt is actually very useful. It lacks examples, but it gives you the syntax of all the requests.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  7. #27
    oopstu is offline Intermediate Member
    Join Date
    Mar 2006
    Posts
    17
    Rep Power
    9

    Default No Messages in Debug Window

    Hi, I recently upgraded to 4.0.4 and actually purchased the Network Edition, and a couple of mail integrations I have aren't working. I tried to pop up the debug window using $set:debug 1 in the client and the debugger comes up, but doesn't seem to receive any messages.

    I just need to confirm that the message strucutres haven't changed, or id the changes so I can make them in our little app.

    Am I doing something wrong, has the debugger changed somehow?

    TIA,
    h

  8. #28
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default Search first!

    Quote Originally Posted by oopstu View Post
    Hi, I recently upgraded to 4.0.4 and actually purchased the Network Edition, and a couple of mail integrations I have aren't working. I tried to pop up the debug window using $set:debug 1 in the client and the debugger comes up, but doesn't seem to receive any messages.

    Am I doing something wrong, has the debugger changed somehow?
    You need to put "?mjsf=true&gzip=false" at the end of the URL for $set:debug 1 to work. Or you can just start the app with ?mjsf=true&gzip=false&debug=1 at the end of the URL...
    Bugzilla - Wiki - Downloads - Before posting... Search!

  9. #29
    oopstu is offline Intermediate Member
    Join Date
    Mar 2006
    Posts
    17
    Rep Power
    9

    Default No luck

    I tried that url in Safari, Firefox, IE 7 and IE 6 all to no avail.

    I still get the debugging window, but it's not logging interactions.

    I've tried http://server:port/zimbra/mail?mjsf=...=false&debug=1

    and

    http://serverort/?mjsf=true&gzip=false&debug=1

    Could it be that I run Zimbra on a port other than 80 or am I doing something else wrong?

  10. #30
    oopstu is offline Intermediate Member
    Join Date
    Mar 2006
    Posts
    17
    Rep Power
    9

    Default Kind of working.

    I have the debugger kind of responding now, but it just says "New Run" for login and log out. with a timestamp with no other info.

Page 3 of 4 FirstFirst 1234 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Zimbra shutdowns every n hours.
    By Andrewb in forum Administrators
    Replies: 13
    Last Post: 08-14-2007, 08:55 AM
  2. 4.5 Upgrade failure
    By brained in forum Installation
    Replies: 9
    Last Post: 03-03-2007, 03:30 PM
  3. svn version still won't start
    By kinaole in forum Developers
    Replies: 0
    Last Post: 10-04-2006, 06:47 AM
  4. Logger
    By jholder in forum Installation
    Replies: 24
    Last Post: 03-31-2006, 11:50 AM
  5. port 7071 not listening OS X install
    By leeimber in forum Installation
    Replies: 7
    Last Post: 03-21-2006, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •