Page 1 of 4 123 ... LastLast
Results 1 to 10 of 35

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

  1. #1
    Hemant Shrivastava is offline Junior Member
    Join Date
    Nov 2006
    Posts
    5
    Rep Power
    8

    Question How to consume zimbra SOAP API in my java application

    Hi,

    I am getting problem while trying to consume zimbra web service. The web services which I had consumed earlier, those were RPC style based soap oriented web services and for which I had been given a WSDL document reference URL, describing that web service. So I was able to generate the proxy stubs and classes in my programming framework, and therefore didn't have any problem.

    Now since Zimbra web service is a document style web service (not RPC based), so it does not provide me a WSDL document reference URL, so I cannot generate stubs to simply use them. Now what I understand is that it should be a simple XML/SOAP document exchange based mechanism to send the request and get the response, while communicating to the document style based Zimbra web service.

    I have been given the attached soap API documentation, which only tells me the request / response headers in XML format, but when I am the sending appropriate XML NODE to the given URL (mentioned below), I am getting an exception

    "Server returned HTTP response code: 500 for URL: https://zimbra.vsnl.in:7071/service/admin/soap/"

    URL: https://zimbra.vsnl.in:7071/service/admin/soap/

    XML NODE:

    <AuthRequest xmlns="urn:zimbraAdmin">

    <name>admin@zimbra.vsnl.in</name>

    <password>DummyPwd</password>

    </AuthRequest>

    I have tried with the following SOAP header as well, but still get the same error message

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

    <soap:Header>

    <context xmlns="urn:zimbra"/>

    </soap:Header>

    <soap:Body>

    <AuthRequest xmlns="urn:zimbraAdmin">

    <name>admin@zimbra.vsnl.com</name>

    <password>DummyPwd</password>

    </AuthRequest>

    </soap:Body>

    </soap:Envelope>


    The server is properly configured and admin control panel is accessible on browser on port 7071.

    Can you help me understand, if there is some other way I need to pass the params to the given URL? If not then what would be the alternative solution. I tried to dig out in the source code also and it shows that the appropriate servlet "SoapServlet", listning on port 7071 takes the request as query string params only. Please help!!!!!

    Regards,
    Hemant Shrivastava

  2. #2
    sam
    sam is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    10

    Default

    Here's a sample request sent by my app that works. You can compare it with yours and see whats different. What is in the body of the response sent by the server; it usually indicates what is wrong.

    --Begin HTTP Request

    POST /service/admin/soap/ HTTP/1.1
    Content-Type: application/soap+xml; charset=utf-8
    User-Agent: Test application
    Host: localhost:7071
    Content-Length: 308
    Connection: Keep-Alive
    Cache-Control: no-cache
    Pragma: no-cache

    <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@ak.zimbra.com</name><password>test123</password></AuthRequest></soap:Body></soap:Envelope>
    Sam Khavari

    :: :: [ Zimbra ] :: :: [ Bugzilla ] :: :: [ Product Portal ] :: :: [ Wiki ] :: :: [ Downloads ] :: :: [ . ] ::

  3. #3
    Hemant Shrivastava is offline Junior Member
    Join Date
    Nov 2006
    Posts
    5
    Rep Power
    8

    Question Re: How to consume zimbra SOAP API in my java application

    HI Sam,

    Thanks for your valuable input.

    I have two further things to be clarified.

    1). When I call admin soap api to create an account, if the inputs goes correct to it, it gives me correct result, but if any input goes wrong to it, or let say if i try to create an existing account, instead of giving me a failure SOAP response, it straight-away throws an internal server error with an exception code 500. I get the following error message

    "Server returned HTTP response code: 500 for URL: https://zimbra.vsnl.in:7071/service/admin/"

    This behavior i have observed with the domain creation soap API as well. Is it the default behavior in case a SOAP API execution is un-successfull.

    2) I have the soap-admin.txt doc available with me from /opt/zimbra/doc

    This document gives the basic inputs in XML format to the admin soap API's but doesn't provide me the SOAP format, corresponding to different types of request, such as modifying a user account, or such as modifying a domain , getting a specific user account attribute etc.

    Is there any document availble which can provide me the SOAP format for making requests.

    Thanks in advance,
    Regards,
    Hemant Shrivastava

  4. #4
    sam
    sam is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    10

    Default

    the only documentation is whatever is in the ZimbraServer\docs directory. What is very helpful is to enable the debug logging in the admin console and see what requests it sends to the server.

    1. Login to the admin console (https://server:7071/zimbraAdmin)
    2. in the search box type '$set:debug 1' and hit enter
    3. you'll see a dialog box popup that displays all the request/responses sent from the admin console

    So if you wanted to see how to modify an account, you could modify the account using the admin console and see how it uses ModifyAccountRequest to apply the changes on the server.
    Sam Khavari

    :: :: [ Zimbra ] :: :: [ Bugzilla ] :: :: [ Product Portal ] :: :: [ Wiki ] :: :: [ Downloads ] :: :: [ . ] ::

  5. #5
    Hemant Shrivastava is offline Junior Member
    Join Date
    Nov 2006
    Posts
    5
    Rep Power
    8

    Question

    Hi Sam,

    As per your instructions, i have set the debug mode to level 1 in the admin control panel, so a dialog popup appears as you said.

    But when i modify the account using admin console, nothing appears in the debug window. The account is getting modified although. Only two buttons "Mark" & "Clear" on the left nav appears.

    Is it some else where do i need to look into to enable the logging.

    Regards,
    Hemant Shrivastava

  6. #6
    sam
    sam is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    10

    Default

    try going here:

    https://server:7071/?mode=mjsf&gzip=false&debug=1

    this should launch the debug window
    Sam Khavari

    :: :: [ Zimbra ] :: :: [ Bugzilla ] :: :: [ Product Portal ] :: :: [ Wiki ] :: :: [ Downloads ] :: :: [ . ] ::

  7. #7
    Hemant Shrivastava is offline Junior Member
    Join Date
    Nov 2006
    Posts
    5
    Rep Power
    8

    Default Re: How to consume zimbra SOAP API in my java application

    Thanks Sam,

    I am able to get the SOAP headers in the debug window now.
    Can you refer some existing open source soap client in JAVA, using which i can generate these SOAP headers.

    I am right now using JDOM to parse the received SOAP responses....
    Generating SOAP headers using JDOM is a cumborsome exercise.

    Regards,
    Hemant Shrivastava

  8. #8
    sam
    sam is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    10

    Default

    The open source ZCS codebase has some code you might be interested in. Take a look at ZClient under ZimbraCommon. If that doesn't work:

    http://www.google.com/search?q=java+soap
    Sam Khavari

    :: :: [ Zimbra ] :: :: [ Bugzilla ] :: :: [ Product Portal ] :: :: [ Wiki ] :: :: [ Downloads ] :: :: [ . ] ::

  9. #9
    sam
    sam is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    10

    Default

    sorry, ZClient is under ZimbraServer:

    http://zimbra.svn.sourceforge.net/vi...ra/cs/zclient/
    Sam Khavari

    :: :: [ Zimbra ] :: :: [ Bugzilla ] :: :: [ Product Portal ] :: :: [ Wiki ] :: :: [ Downloads ] :: :: [ . ] ::

  10. #10
    Hemant Shrivastava is offline Junior Member
    Join Date
    Nov 2006
    Posts
    5
    Rep Power
    8

    Angry Re: How to consume zimbra SOAP API in my java application

    Hi Sam,

    When I get the user account details via SOAP API's, the value of userPassword attribute comes as blocked.

    <a n="userPassword">VALUE-BLOCKED</a>

    SO i cannot fetch the user password value, thru a SOAP API call.

    Is there anyway i can disable the VALUE-BLOCKED fetaure of userPassword attribute.

    This is important & urgent so kindly help me in knowing how can i fetch the user password.

    Regards,
    Hemant Shrivastava

Page 1 of 4 123 ... 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
  •