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 02-05-2011, 10:40 AM
Intermediate Member
 
Posts: 15
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?
Reply With Quote
  #2 (permalink)  
Old 02-06-2011, 01:51 AM
Intermediate Member
 
Posts: 15
Default

Can anyone help me?

Please
Reply With Quote
  #3 (permalink)  
Old 02-20-2011, 04:37 PM
Active Member
 
Posts: 33
Default

Most probably you have incorrect xmlns values.
Verify/correct them and try again.
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.