Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 09-20-2006, 10:50 PM
Junior Member
 
Posts: 5
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
Reply With Quote
  #2 (permalink)  
Old 09-21-2006, 01:17 AM
Junior Member
 
Posts: 5
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.
Reply With Quote
  #3 (permalink)  
Old 01-07-2008, 11:52 AM
Junior Member
 
Posts: 9
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 ...
Reply With Quote
  #4 (permalink)  
Old 01-07-2008, 12:11 PM
Zimbra Employee
 
Posts: 1,434
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!
Reply With Quote
  #5 (permalink)  
Old 01-07-2008, 02:13 PM
Junior Member
 
Posts: 9
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)
Reply With Quote
  #6 (permalink)  
Old 01-07-2008, 04:06 PM
Zimbra Employee
 
Posts: 1,434
Default

Is there a chance that you have the wrong version of commons-httpclient.jar?
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #7 (permalink)  
Old 01-07-2008, 06:04 PM
Junior Member
 
Posts: 9
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.
Reply With Quote
  #8 (permalink)  
Old 01-08-2008, 10:06 AM
Zimbra Employee
 
Posts: 1,434
Default

I think that commons-httpclient-3.0 may require a different commons-codec.jar as well...
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #9 (permalink)  
Old 01-08-2008, 11:20 AM
Junior Member
 
Posts: 9
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.
Reply With Quote
  #10 (permalink)  
Old 01-08-2008, 11:44 AM
Zimbra Employee
 
Posts: 1,434
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!
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0