Results 1 to 10 of 20

Thread: Jar For Soap Client

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    5
    Rep Power
    9

    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
    Join Date
    Sep 2006
    Posts
    5
    Rep Power
    9

    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
    Join Date
    Sep 2007
    Posts
    9
    Rep Power
    8

    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
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    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
    Join Date
    Sep 2007
    Posts
    9
    Rep Power
    8

    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
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default

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

  7. #7
    Join Date
    Jul 2008
    Posts
    91
    Rep Power
    7

    Default

    I cannot get what you all trying to do...

    I run this code

    Code:
    import java.io.IOException;
    import com.zimbra.common.service.ServiceException;
    import com.zimbra.common.soap.Element;
    import com.zimbra.common.soap.SoapHttpTransport;
    import com.zimbra.cs.account.soap.SoapProvisioning;
    import com.zimbra.cs.service.mail.MailService;
    import com.zimbra.cs.service.account.AccountService;
    import com.zimbra.cs.servlet.ZimbraServlet;
    import com.zimbra.cs.util.Zimbra;
    import com.zimbra.soap.ZimbraSoapContext;
    
    public class TestZClient {
        public static void main(String [] args) throws ServiceException
        {
      SoapProvisioning sp = new SoapProvisioning();
            sp.soapSetURI("https://3.244.4.16:7071/zimbraAdmin/");
            sp.soapAdminAuthenticate("admin","fsloke999");
            System.out.println(sp.GM_ZIMBRA);
        }
    }
    but the warning code is:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/DocumentException
    at com.zimbra.cs.account.soap.SoapProvisioning.soapSe tURI(SoapProvisioning.java:89)
    at TestZClient.main(TestZClient.java:45)
    Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
    ... 2 more
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)
    Thank you
    Last edited by fsloke; 09-30-2008 at 08:18 AM.

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

    Default

    Looks like you're missing a library. Add dom4j-1.5.jar to your Java classpath and try again.
    Bugzilla - Wiki - Downloads - Before posting... Search!

Similar Threads

  1. Replies: 12
    Last Post: 08-25-2010, 03:37 AM
  2. Deploying Zimbra Client (zimbra.war)
    By zocs in forum Installation
    Replies: 2
    Last Post: 07-25-2007, 06: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, 01: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
  •