Results 1 to 3 of 3

Thread: access zimbra from java using soap

  1. #1
    Join Date
    Jan 2011
    Posts
    15
    Rep Power
    4

    Default access zimbra from java using soap

    Hi,

    I have a problems with accesssing zimbra using soap from java:
    I have a following code:

    String url = "http://webmail.etf.unsa.ba/service/soap";
    HttpConnection hc = (HttpConnection)Connector.open(url);
    String msg="<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>az15032@etf.unsa.ba</name>"+
    "<password>mypass</password>"+
    "</AuthRequest>"+
    "</soap:Body>"+
    "</soap:Envelope>";
    hc.setRequestMethod(HttpConnection.POST);
    //Content-Type: application/soap+xml; charset=utf-8
    hc.setRequestProperty("Content-Type", "application/soap+xml");
    OutputStream os=hc.openOutputStream();
    os.write(msg.getBytes());
    os.close();
    //show http response

    When I run code it shows me response:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra"/></soap:Header><soap:Body><soap:Fault><soap:Code><soa p:Value>soap:Sender</soap:Value></soap:Code><soap:Reason><soap:Text>unknown document: AuthRequest</soap:Text></soap:Reason><soapetail><Error xmlns="urn:zimbra"><Code>service.UNKNOWN_DOCUMENT</Code><Trace>btpool0-7987://webmail.etf.unsa.ba/service/soap:1296930874715:07d42a5f8e25cf53</Trace></Error></soapetail></soap:Fault>
    </soap:Body>
    </soap:Envelope>

    What could be a problem here?

    Any suggestions?

  2. #2
    Join Date
    Jan 2011
    Posts
    15
    Rep Power
    4

    Default

    Can anyone help me?

    Please

  3. #3
    Join Date
    Oct 2007
    Posts
    33
    Rep Power
    7

    Default

    Most probably you have incorrect xmlns values.
    Verify/correct them and try again.

Similar Threads

  1. ZCS7 Beta only Listens on IPv6
    By tobru in forum Installation
    Replies: 2
    Last Post: 03-25-2011, 03:31 AM
  2. Major Issue - 5.0RC2 NE to 5.0GA NE failed
    By DougWare in forum Installation
    Replies: 7
    Last Post: 01-06-2008, 08:56 PM
  3. Can't start Zimbra!
    By zibra in forum Administrators
    Replies: 5
    Last Post: 03-22-2007, 11:34 AM
  4. Unable to start tomcat
    By chanck in forum Administrators
    Replies: 11
    Last Post: 06-11-2006, 12:58 AM
  5. Zimbra server crashed
    By goetzi in forum Administrators
    Replies: 6
    Last Post: 03-25-2006, 12:00 PM

Posting Permissions

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