Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Jar For Soap Client

  1. #1
    wcameron is offline Junior Member
    Join Date
    Sep 2006
    Posts
    5
    Rep Power
    8

    Default Jar For Soap Client

    In looking at the Subversion Of Zimbra

    I can see the soap*.txt files regarding Zimbra soap documentation
    And i have looked at the Zimbra Soap requests via the Ajax Web Client
    Using the parameter debug=1

    This has given me good understanding of what is possible.

    There are two avenues i would like to persue in using the soap side of things.

    1) Work out how to configure the Zimbra tomcat instance to serve our own content, so that I can access the zimlets directly, outside the zimbra web client. Using the Zimbra ajax client to construct soap requests and get back JSON results. I am a bit lost as to if this is possible? and if so how do i do it?

    2) I would like to be able to write a Java soap client that accesses the Zimbra soap services. I can see inside Tester.java a lot of examples etc.
    But i need to be able to download a Zimbra Client jar file that has just what is needed to make the soap calls. So I can use this inside my Java APP to make the soap calls.

    Can anayone guide me on how to go about these two things. I have been trying a range of things and so far no joy.

    Apologies for newby question

  2. #2
    wcameron is offline Junior Member
    Join Date
    Sep 2006
    Posts
    5
    Rep Power
    8

    Default Soap Q's

    Also I cant quite determine what the soap urls actually should be.
    For my server.

    it would be good to see the pure output and know what im dealing with.

    Ie a mock request in order to view a response.

    I know my domain name, and user name and password

    I am unclear about after that.

  3. #3
    ozomozo is offline Junior Member
    Join Date
    Sep 2007
    Posts
    9
    Rep Power
    7

    Default

    I have major SOAP connectivity issues as well and have almost given up pursuing this. I tried using the Java code mentioned in an earlier post to no avail. Here is my code and the errors are meaningless as i dont have the source code for SoapTransport..

    SoapProvisioning sp = new SoapProvisioning();
    sp.soapSetURI("https://localhost:7071/zimbraAdmin/");
    sp.soapAdminAuthenticate("admin","password");
    createZimbraAccount = sp.createAccount("username", "password", getMap());

    and my error is ...
    at org.apache.commons.logging.LogFactory.getLog(LogFa ctory.java:353)
    at org.apache.commons.httpclient.HttpClient.<clinit>( HttpClient.java:69)
    at com.zimbra.soap.SoapHttpTransport.<init>(SoapHttpT ransport.java:61)
    at ZimbraSoap.createUser(ZimbraSoap.java:173)
    at ZimbraSoap.main(ZimbraSoap.java:42)


    Ive included zimbrastore.jar into my project along with the other jar files. is your issue similar to this ...

  4. #4
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    11

    Default

    The source for SoapTransport can be found in the source tgz bundle.

    Can you post the rest of the exception that you're having? You've cut off the top of the stack trace, and that would tell us what the exception actually was.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  5. #5
    ozomozo is offline Junior Member
    Join Date
    Sep 2007
    Posts
    9
    Rep Power
    7

    Default

    dkarp ... here you go ... appreciate the quick reply ...

    log4j:ERROR setFile(null,true) call failed.
    java.io.FileNotFoundException: target/activemq-test.log (No such file or directory)
    at java.io.FileOutputStream.openAppend(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.j ava:177)
    at java.io.FileOutputStream.<init>(FileOutputStream.j ava:102)
    at org.apache.log4j.FileAppender.setFile(FileAppender .java:272)
    at org.apache.log4j.FileAppender.activateOptions(File Appender.java:151)
    at org.apache.log4j.config.PropertySetter.activate(Pr opertySetter.java:247)
    at org.apache.log4j.config.PropertySetter.setProperti es(PropertySetter.java:123)
    at org.apache.log4j.config.PropertySetter.setProperti es(PropertySetter.java:87)
    at org.apache.log4j.PropertyConfigurator.parseAppende r(PropertyConfigurator.java:645)
    at org.apache.log4j.PropertyConfigurator.parseCategor y(PropertyConfigurator.java:603)
    at org.apache.log4j.PropertyConfigurator.configureRoo tCategory(PropertyConfigurator.java:500)
    at org.apache.log4j.PropertyConfigurator.doConfigure( PropertyConfigurator.java:406)
    at org.apache.log4j.PropertyConfigurator.doConfigure( PropertyConfigurator.java:432)
    at org.apache.log4j.helpers.OptionConverter.selectAnd Configure(OptionConverter.java:460)
    at org.apache.log4j.LogManager.<clinit>(LogManager.ja va:113)
    at org.apache.log4j.Logger.getLogger(Logger.java:85)
    at org.apache.commons.logging.impl.Log4JLogger.getLog ger(Log4JLogger.java:261)
    at org.apache.commons.logging.impl.Log4JLogger.<init> (Log4JLogger.java:97)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:494)
    at org.apache.commons.logging.impl.LogFactoryImpl.new Instance(LogFactoryImpl.java:529)
    at org.apache.commons.logging.impl.LogFactoryImpl.get Instance(LogFactoryImpl.java:235)
    at org.apache.commons.logging.impl.LogFactoryImpl.get Instance(LogFactoryImpl.java:209)
    at org.apache.commons.logging.LogFactory.getLog(LogFa ctory.java:353)
    at org.apache.commons.httpclient.HttpClient.<clinit>( HttpClient.java:69)
    at com.zimbra.soap.SoapHttpTransport.<init>(SoapHttpT ransport.java:61)
    at com.zimbra.cs.account.soap.SoapProvisioning.soapSe tURI(SoapProvisioning.java:78)
    at ZimbraSoap.createAccount(ZimbraSoap.java:140)
    at ZimbraSoap.main(ZimbraSoap.java:43)
    Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.httpclient.methods.PostMethod.s etRequestContentLength(J)V
    at com.zimbra.soap.SoapHttpTransport.invoke(SoapHttpT ransport.java:177)
    at com.zimbra.soap.SoapTransport.invoke(SoapTransport .java:225)
    at com.zimbra.cs.account.soap.SoapProvisioning.invoke (SoapProvisioning.java:146)
    at com.zimbra.cs.account.soap.SoapProvisioning.soapAd minAuthenticate(SoapProvisioning.java:118)
    at ZimbraSoap.createAccount(ZimbraSoap.java:141)
    at ZimbraSoap.main(ZimbraSoap.java:43)

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

    Default

    Is there a chance that you have the wrong version of commons-httpclient.jar?
    Bugzilla - Wiki - Downloads - Before posting... Search!

  7. #7
    ozomozo is offline Junior Member
    Join Date
    Sep 2007
    Posts
    9
    Rep Power
    7

    Default

    Ive tried using commons-httpclient-3.0.jar as well as commons-httpclient.jar...

    When I use the 3.0 jar file this is my error:
    ___________________________________________
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException
    at org.apache.commons.httpclient.HttpMethodBase.<init >(HttpMethodBase.java:217)
    at org.apache.commons.httpclient.methods.ExpectContin ueMethod.<init>(ExpectContinueMethod.java:92)
    at org.apache.commons.httpclient.methods.EntityEnclos ingMethod.<init>(EntityEnclosingMethod.java:118)
    at org.apache.commons.httpclient.methods.PostMethod.< init>(PostMethod.java:105)
    at com.zimbra.soap.SoapHttpTransport.invoke(SoapHttpT ransport.java:170)
    at com.zimbra.soap.SoapTransport.invoke(SoapTransport .java:225)
    at com.zimbra.cs.account.soap.SoapProvisioning.invoke (SoapProvisioning.java:146)
    at com.zimbra.cs.account.soap.SoapProvisioning.soapAd minAuthenticate(SoapProvisioning.java:118)
    at ZimbraSoap.createAccount(ZimbraSoap.java:141)
    at ZimbraSoap.main(ZimbraSoap.java:43)
    __________________________________________________ _____________

    Using the commons-httpclient.jar file produces the original error.

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

    Default

    I think that commons-httpclient-3.0 may require a different commons-codec.jar as well...
    Bugzilla - Wiki - Downloads - Before posting... Search!

  9. #9
    ozomozo is offline Junior Member
    Join Date
    Sep 2007
    Posts
    9
    Rep Power
    7

    Default

    dkarp ... thanks a lot for the replies .. my faith is being restored

    adding commons-codec-1.3.jar definitely helped and im much further down the path ... however I get this new exception. If you can point the way it would be great ....im using
    Eclipse IDE on Linux and Zimbra 4.8 ....

    __________________________________________________ _____________________
    com.zimbra.cs.zclient.ZClientException: invoke unable to parse response: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <!--
    * ***** BEGIN LICENSE BLOCK *****
    * Zimbra Collaboration Suite Web Client
    * Copyright (C) 2004, 2005, 2006, 2007 Zimbra, Inc.
    *
    * The contents of this file are subject to the Yahoo! Public License
    * Version 1.0 ("License"); you may not use this file except in
    * compliance with the License. You may obtain a copy of the License at
    * http://www.zimbra.com/license.
    *
    * Software distributed under the License is distributed on an "AS IS"
    * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
    * ***** END LICENSE BLOCK *****
    -->
    <title>Zimbra Administration</title>
    <link rel="ICON" type="image/gif" href="/img/loRes/logo/favicon.gif"/>
    <link rel="SHORTCUT ICON" href="/img/loRes/logo/favicon.ico"/>

    <script>
    appContextPath = "/zimbraAdmin";
    appCurrentSkin = "sand";
    </script>
    <script type="text/javascript" src="/zimbraAdmin/js/msgs/I18nMsg,AjxMsg,ZMsg,ZaMsg,ZmMsg.js?v=071002234727" ></script>
    <script type="text/javascript" src="/zimbraAdmin/js/keys/AjxKeys.js?v=071002234727"></script>
    <style type="text/css">
    <!--
    @import url(/zimbraAdmin/css/dwt,common,zmadmin,login,msgview,spellcheck,imgs,s and_imgs,skin.css?v=071002234727&skin=sand);
    -->
    </style>
    <script type="text/javascript" src="/zimbraAdmin/js/Ajax_all.js?v=071002234727"></script>
    <script type="text/javascript" src="/zimbraAdmin/js/ZimbraAdmin_all.js?v=071002234727"></script>
    <script type="text/javascript" language="JavaScript">
    function launch() {
    AjxWindowOpener.HELPER_URL = "/zimbraAdmin/public/frameOpenerHelper.jsp"
    DBG = new AjxDebug(AjxDebug.NONE, null, false);
    ACCESS_RIGHTS = new Object();
    // figure out the debug level
    if (location.search && (location.search.indexOf("debug=") != -1)) {
    var m = location.search.match(/debug=(\w+)/);
    if (m && m.length) {
    var level = m[1];
    if (level == 't') {
    DBG.showTiming(true);
    } else {
    DBG.setDebugLevel(level);
    }
    }
    }
    ZaZimbraAdmin.run(document.domain);
    }

    // START DOMContentLoaded
    // Mozilla and Opera 9 expose the event we could use
    if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", launch, null);

    // mainly for Opera 8.5, won't be fired if DOMContentLoaded fired already.
    document.addEventListener("load", launch, null);
    }

    // for Internet Explorer. readyState will not be achieved on init call
    if (!AjxEnv || (AjxEnv.isIE && AjxEnv.isWindows)) {
    document.attachEvent("onreadystatechange", function(e) {
    if (document.readyState == "complete") {
    launch();
    }
    });
    }

    if (/(WebKit|khtml)/i.test(navigator.userAgent)) { // sniff
    var _timer = setInterval(function() {
    if (/loaded|complete/.test(document.readyState)) {
    launch();
    // call the onload handler
    }
    }, 10);
    }
    // END DOMContentLoaded
    AjxCore.addOnloadListener(launch);
    </script>
    </head>
    <body>
    <script type="text/javascript" language=Javascript>
    skin.hideQuota();
    skin.hideTreeFooter();
    </script>
    </body>
    </html>, server: localhost
    at com.zimbra.cs.zclient.ZClientException.IO_ERROR(ZC lientException.java:44)
    at com.zimbra.cs.account.soap.SoapProvisioning.invoke (SoapProvisioning.java:150)
    at com.zimbra.cs.account.soap.SoapProvisioning.soapAd minAuthenticate(SoapProvisioning.java:118)
    at ZimbraSoap.main(ZimbraSoap.java:44)
    Caused by: com.zimbra.soap.SoapParseException: unable to parse response: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <!--
    * ***** BEGIN LICENSE BLOCK *****
    * Zimbra Collaboration Suite Web Client
    * Copyright (C) 2004, 2005, 2006, 2007 Zimbra, Inc.
    *
    * The contents of this file are subject to the Yahoo! Public License
    * Version 1.0 ("License"); you may not use this file except in
    * compliance with the License. You may obtain a copy of the License at
    * http://www.zimbra.com/license.
    *
    * Software distributed under the License is distributed on an "AS IS"
    * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
    * ***** END LICENSE BLOCK *****
    -->
    <title>Zimbra Administration</title>
    <link rel="ICON" type="image/gif" href="/img/loRes/logo/favicon.gif"/>
    <link rel="SHORTCUT ICON" href="/img/loRes/logo/favicon.ico"/>

    <script>
    appContextPath = "/zimbraAdmin";
    appCurrentSkin = "sand";
    </script>
    <script type="text/javascript" src="/zimbraAdmin/js/msgs/I18nMsg,AjxMsg,ZMsg,ZaMsg,ZmMsg.js?v=071002234727" ></script>
    <script type="text/javascript" src="/zimbraAdmin/js/keys/AjxKeys.js?v=071002234727"></script>
    <style type="text/css">
    <!--
    @import url(/zimbraAdmin/css/dwt,common,zmadmin,login,msgview,spellcheck,imgs,s and_imgs,skin.css?v=071002234727&skin=sand);
    -->
    </style>
    <script type="text/javascript" src="/zimbraAdmin/js/Ajax_all.js?v=071002234727"></script>
    <script type="text/javascript" src="/zimbraAdmin/js/ZimbraAdmin_all.js?v=071002234727"></script>
    <script type="text/javascript" language="JavaScript">
    function launch() {
    AjxWindowOpener.HELPER_URL = "/zimbraAdmin/public/frameOpenerHelper.jsp"
    DBG = new AjxDebug(AjxDebug.NONE, null, false);
    ACCESS_RIGHTS = new Object();
    // figure out the debug level
    if (location.search && (location.search.indexOf("debug=") != -1)) {
    var m = location.search.match(/debug=(\w+)/);
    if (m && m.length) {
    var level = m[1];
    if (level == 't') {
    DBG.showTiming(true);
    } else {
    DBG.setDebugLevel(level);
    }
    }
    }
    ZaZimbraAdmin.run(document.domain);
    }

    // START DOMContentLoaded
    // Mozilla and Opera 9 expose the event we could use
    if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", launch, null);

    // mainly for Opera 8.5, won't be fired if DOMContentLoaded fired already.
    document.addEventListener("load", launch, null);
    }

    // for Internet Explorer. readyState will not be achieved on init call
    if (!AjxEnv || (AjxEnv.isIE && AjxEnv.isWindows)) {
    document.attachEvent("onreadystatechange", function(e) {
    if (document.readyState == "complete") {
    launch();
    }
    });
    }

    if (/(WebKit|khtml)/i.test(navigator.userAgent)) { // sniff
    var _timer = setInterval(function() {
    if (/loaded|complete/.test(document.readyState)) {
    launch();
    // call the onload handler
    }
    }, 10);
    }
    // END DOMContentLoaded
    AjxCore.addOnloadListener(launch);
    </script>
    </head>
    <body>
    <script type="text/javascript" language=Javascript>
    skin.hideQuota();
    skin.hideTreeFooter();
    </script>
    </body>
    </html>
    at com.zimbra.soap.SoapTransport.parseSoapResponse(So apTransport.java:180)
    at com.zimbra.soap.SoapHttpTransport.invoke(SoapHttpT ransport.java:207)
    at com.zimbra.soap.SoapTransport.invoke(SoapTransport .java:225)
    at com.zimbra.cs.account.soap.SoapProvisioning.invoke (SoapProvisioning.java:146)
    ... 2 more

    __________________________________________________ __________-
    Last edited by ozomozo; 01-08-2008 at 11:23 AM.

  10. #10
    dkarp is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    11

    Default

    Oops. You've got the wrong URI.

    I think you want to use https://localhost:7071/zimbraAdmin/service/soap instead.
    Bugzilla - Wiki - Downloads - Before posting... Search!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 12
    Last Post: 08-25-2010, 02:37 AM
  2. Deploying Zimbra Client (zimbra.war)
    By zocs in forum Installation
    Replies: 2
    Last Post: 07-25-2007, 05:24 AM
  3. Zimbra client with another server
    By JayBee in forum Developers
    Replies: 6
    Last Post: 02-16-2007, 10:44 PM
  4. Zimbra XUL/AJAX rich client?
    By voidless in forum Users
    Replies: 2
    Last Post: 10-08-2005, 12:22 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
  •