Results 1 to 7 of 7

Thread: SOAP question

  1. #1
    Join Date
    Nov 2006
    Posts
    8
    Rep Power
    8

    Default SOAP question

    I've been trying to work with zimbra's SOAP interface with limited success. I'm able to do an AuthRequest, but now when I try doing a GetInfoRequest it doesn't work. I'm a bit of a novice at this so I was hoping someone could give me a hand. I'm sending the following request to https://ourzimbraserver:7071/service/admin/soap

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:zimbraAccount" xmlns:ns2="urn:zimbra" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Header>
    <ns2:nosession/>
    <ns2:authToken>valid authtoken</ns2:authToken>
    <ns2:account>user@domain.com</ns2:account>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <ns1:GetInfoRequest/>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    So the idea is that this does GetInfoRequest for user@domain.com. So can anyone tell me what I'm doing wrong?

  2. #2
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default What was the error?

    Without the resulting SOAP fault, it's hard to diagnose your issue. And your life may be made much easier by turning on the debug window on the web client and watching the SOAP fly from the client to the server.

    The big thing I see wrong with your SOAP is that you're putting elements directly into the SOAP <Header> instead of in the Zimbra <context> subelement, which means your auth token won't be picked up.

    In general, don't include <account> in the <context> unless you're specifying an account other than the authenticated user. If you do include <account>, make sure to also include by="name"; a "by" value is required.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  3. #3
    Join Date
    Nov 2006
    Posts
    8
    Rep Power
    8

    Default

    Thanks, this was enough to get me pointed in the right direction.

    Tip for other PHP developers out there, don't try using PHP5's SOAP client for talking to Zimbra, its unbelievably cumbersome for anything that doesn't have a WSDL.

  4. #4
    Join Date
    Nov 2006
    Posts
    19
    Rep Power
    8

    Default

    Where can I find documentation on zimbra's SOAP interface ?

  5. #5
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    11

    Default

    Sam Khavari

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

  6. #6
    Join Date
    Nov 2006
    Posts
    19
    Rep Power
    8

    Default

    Is SOAP interface in production level ?

    Does Zimbra have REST interface as well?

  7. #7
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default Yes and yes.

    The SOAP interface is the server's primary interface; all Zimbra's clients use the SOAP interface.

    Zimbra also has a REST interface for fetching data; please search the wiki for details!
    Bugzilla - Wiki - Downloads - Before posting... Search!

Similar Threads

  1. Zimbra SOAP Question
    By jonnybravo in forum Developers
    Replies: 8
    Last Post: 07-26-2007, 04:09 PM
  2. Question on SOAP compatibility
    By Robin Diederen in forum Developers
    Replies: 3
    Last Post: 09-19-2006, 01:26 AM
  3. SOAP / tns / TomCat question
    By Robin Diederen in forum Developers
    Replies: 3
    Last Post: 06-27-2006, 01:43 PM
  4. another SOAP related dumb question...
    By antonio.meireles in forum Administrators
    Replies: 2
    Last Post: 10-17-2005, 11:58 AM
  5. SOAP - dumb question of the day
    By antonio.meireles in forum Developers
    Replies: 1
    Last Post: 10-14-2005, 09:29 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
  •