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 Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-22-2008, 08:25 AM
Junior Member
 
Posts: 5
Default Tester.java question

I'm trying to learn how to use SOAP to talk to the zimbra server by studying the Tester.java class. I can run it and part of it works, but I get an exception when it tries to upload an attachment around line 668.
The code is:
// add an attachment. XXX hardcoded stuff...
String aid = smr.postAttachment("https://zm.humboldt.edu:7071/service/upload",
session, new File("/home/paj1/zimbra/com/zimbra/cs/client/soap/Tester.java"), ".humboldt.edu", 5000);
System.out.println("got back attachment id " + aid);
lMsg.setAttachmentIDs(new String[] { aid});
System.out.println("got back attachment id 1" );

LmcSendMsgResponse smrResp = (LmcSendMsgResponse) smr.invoke(serverURL);

and the exception is:
got back attachment id tml><head><script language='javascript'>
function doit() { window.parent._uploadManager.loaded(401,'null'); }
</script></head><body onload='doit()
got back attachment id 1
com.zimbra.common.soap.SoapFaultException: invalid request: invalid upload ID: tml><head><script language='javascript'> function doit() { window.parent._uploadManager.loaded(401
ExceptionId:btpool0-65:1211398224679:84d5cd63bcd864fc
Code:service.INVALID_REQUEST
at com.zimbra.common.soap.Soap12Protocol.soapFault(So ap12Protocol.java:88)
at com.zimbra.common.soap.SoapTransport.extractBodyEl ement(SoapTransport.java:245)
at com.zimbra.common.soap.SoapTransport.parseSoapResp onse(SoapTransport.java:221)
at com.zimbra.common.soap.SoapHttpTransport.invoke(So apHttpTransport.java:251)
at com.zimbra.common.soap.SoapTransport.invoke(SoapTr ansport.java:297)
at com.zimbra.common.soap.SoapTransport.invoke(SoapTr ansport.java:261)
at com.zimbra.cs.client.soap.LmcSoapRequest.invoke(Lm cSoapRequest.java:142)
at com.zimbra.cs.client.soap.Tester.main(Tester.java: 620)


clearly, the postAttachment method is not returning a valid attachment id so the invoke method is failing. I'm assuming my parameters to the postAttachment method are incorrect but can't find any documentation on it. I've tried many variations on the parameters with no luck. Any help or suggestions would be appreciated.

Also, can anyone suggest a better way to learn this stuff, maybe a tutorial or additional examples?

thanks
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.