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 06-20-2011, 02:22 AM
Intermediate Member
 
Posts: 17
Default [SOLVED] ZClient : problem with connection to the server

I need to use SOAP API in Zimbra. I'm using the ZClient example, but I have an error when trying to authenticate.

Code:
    public static void main(String argv[]) {
        CliUtil.toolSetup();

        String serverURL = "http://zimbra.server.com:7070" + AdminConstants.ADMIN_SERVICE_URI;
        System.out.println(serverURL);
        String userName = "user";
        String password = "password";

        try {
            /* do a ping */
            LmcPingRequest pr = new LmcPingRequest();
            LmcPingResponse pResp = (LmcPingResponse) pr.invoke(serverURL);
            System.out.println("---------------------------OK------------------------------");

            /* auth first */
            System.out.println("========= AUTHENTICATE ===========");
            LmcAuthRequest auth = new LmcAuthRequest();
            auth.setUsername(userName);
            auth.setPassword(password);
            LmcAuthResponse authResp = (LmcAuthResponse) auth.invoke(serverURL);
            LmcSession session = authResp.getSession();
Code:
java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
I use Zimbra and CAS, and I have and zm_auth_token. How to resolve this please ?
thnx
Reply With Quote
  #2 (permalink)  
Old 06-20-2011, 04:18 AM
Project Contributor
 
Posts: 92
Default

At first, please chcek if "serverURL" is correct one or not.

Usually, the protocol and the port used for admin interface is https and 7071.

You can check that with the request sent from Admin UI using firefox and
firebug.
Reply With Quote
  #3 (permalink)  
Old 06-20-2011, 05:20 AM
Intermediate Member
 
Posts: 17
Default

Quote:
Originally Posted by yutaka View Post
At first, please chcek if "serverURL" is correct one or not.

Usually, the protocol and the port used for admin interface is https and 7071.

You can check that with the request sent from Admin UI using firefox and
firebug.
Thnx for your response.

The URL is the good one, I have a simple user that will search on the Zimbra server using SOAP, he is connected via CAS and have a zm_auth_token.
The server always refuse connection.

And when I use 7071, this is the error :

Code:
http://zimbra.server.com:7071/service/soap/admin/
[] INFO: I/O exception (org.apache.commons.httpclient.NoHttpResponseException) caught when processing request: The server zimbra.server.com failed to respond
[] INFO: Retrying request
org.apache.commons.httpclient.NoHttpResponseException: The server zimbra.server.com failed to respond
	at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1835)
	at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
Reply With Quote
  #4 (permalink)  
Old 06-20-2011, 05:33 AM
Project Contributor
 
Posts: 92
Default

How about https?
Still not working?

And zimbra.server.com is ZimbraStore server, ritght?
Reply With Quote
  #5 (permalink)  
Old 06-20-2011, 05:36 AM
Intermediate Member
 
Posts: 17
Default

Quote:
Originally Posted by yutaka View Post
How about https?
Still not working?
We don't use HTTPS, and when I use it, it gives me a certificate error...

Is there any manner to pass the authToken in the url like in REST ???
Because in REST, when I do this :

Code:
http://zimbra.server.com/home/taichimaro/calendar?fmt=xml&auth=qp&zauthtoken=0_07ab6d5dad7bc93d61562eca1c2889582fb7e8ca_69643d33363a61323831353331382d336436362d343766632d386662392d3133613638633661323165393b6578703d31333a313330383733353237303530353b747970653d363a7a696d6272613b
It works... but with SOAP I don't know what is the problem
Reply With Quote
  #6 (permalink)  
Old 06-20-2011, 06:02 AM
Project Contributor
 
Posts: 92
Default

mmmm,

Could you give us Admini UI url you can access from browser?
And Could you check the requested url when you chose some object(maybe account) in Admin UI?(Maybe you better use firebug to check it.)
Reply With Quote
  #7 (permalink)  
Old 06-20-2011, 06:04 AM
Intermediate Member
 
Posts: 17
Default

Quote:
Originally Posted by yutaka View Post
mmmm,

Could you give us Admini UI url you can access from browser?
And Could you check the requested url when you chose some object(maybe account) in Admin UI?(Maybe you better use firebug to check it.)
What do you mean by Admin UI ???
Reply With Quote
  #8 (permalink)  
Old 06-20-2011, 06:13 AM
Project Contributor
 
Posts: 92
Default

UI for administrator. Somthing like this;
Admin UI: Zimbra screenshot
Reply With Quote
  #9 (permalink)  
Old 06-20-2011, 06:16 AM
Intermediate Member
 
Posts: 17
Default

Quote:
Originally Posted by yutaka View Post
UI for administrator. Somthing like this;
Admin UI: Zimbra screenshot
I don't have access to this UI, I have access to a simple account...
__________________
Marouane
Reply With Quote
  #10 (permalink)  
Old 06-20-2011, 06:29 AM
Project Contributor
 
Posts: 92
Default

You install all zimbra component such as ZimbraStore and ZimbraProxy in one server, right?

Then you are supposed to be able to get access to "https://zimbra.server.com:7071/" or "https://zimbra.server.com:7071/zimbraAdmin" from browser.

It does not work for you?
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.