Results 1 to 4 of 4

Thread: help to start with zimlets

  1. #1
    ruculmana is offline Junior Member
    Join Date
    Oct 2006
    Location
    La Paz, Bolivia
    Posts
    5
    Rep Power
    8

    Question help to start with zimlets

    I'm triying to communicate with a web service made with xmlrcp and php. (It's the only one that finally works in my server.)

    The file name is xmlrpc-server.php and it has a function called "onttax".

    The code looks like this:

    Com_Zimbra_Test.prototype.toolTipPoppedUp =
    function(spanElement, obj, context, canvas) {
    canvas.innerHTML = context;
    var request = new AjxRpcRequest();
    var info_url = "http://localhost/xmlrpc-server.php/onttax?par=" + context;
    var url = ZmZimletBase.PROXY + AjxStringUtil.urlEncode(info_url);
    request.invoke(null, url, null, new AjxCallback(this, Com_Zimbra_YMaps._callback, canvas), true);
    };

    I'm not sure about where and how to pass the function's name. I will appreciate any help.

  2. #2
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    18

    Default

    This "Com_Zimbra_YMaps._callback" should be your call back function.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    xenophobia is offline Intermediate Member
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    6

    Default

    I having the same needs here.
    Anyone? Any suggestion? My web-service xmlrpc server is running on PHP while i need my zimlet to communicate and consume the services.

    Can javascript alone able to achieve it? or do I need to write a jsp script? Anyhow, please give us some guide. Thank you!!!!

  4. #4
    xenophobia is offline Intermediate Member
    Join Date
    Sep 2008
    Posts
    20
    Rep Power
    6

    Default Zimlet webservices with xml-rpc.

    I got the way to do it. But I wonder whether is a best practice or not.

    Download the RPC jar lib:
    ws-xmlrpc - Apache XML-RPC
    Take the binary package.

    Since your Zimlet is consuming (client), copy these .jar file to your Zimlet's directory:
    - xmlrpc-client-3.1.x.jar
    - xmlrpc-common-3.1.x.jar
    - ws-commons-util-1.0.x.jar

    You have to place this files under /opt/zimbra/jetty/service/WEB-INF/lib and restart your mailbox services in order to see the effects. If you are using zimbra desktop, it will be more easy and will not affect your live server.

    Write a jsp script file which import the following package:
    Code:
    <%@ page language="java" import="org.apache.xmlrpc.client.XmlRpcClient, org.apache.xmlrpc.client.XmlRpcClientConfigImpl, java.net.URL" %>
    
    XmlRpcClientConfigImpl cfg = new XmlRpcClientConfigImpl();
    cfg.setServerURL(new URL("http://localhost/xmlrpc-server.php/services"));
    
    XmlRpcClient client = new XmlRpcClient();
    client.setConfig(cfg);
    
    Object[] parameters = new Object[] {"param1", "param2"};
    
    // Beware of the return type. Type cast it accordingly. See the documentation at:
    // http://ws.apache.org/xmlrpc/
    Object returned_value = (Object) client.execute("method_name", parameters);
    So far I got it working. The documentation in: ws-xmlrpc - Apache XML-RPC is not completely correct. You have to debug your own sometimes.

    Hope this help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 02-03-2011, 07:01 AM
  2. Zimbra .pids / service monitoring
    By bin2hex in forum Administrators
    Replies: 24
    Last Post: 04-03-2010, 09:12 PM
  3. After reboot mailbox and tomcat don't start
    By gon in forum Administrators
    Replies: 1
    Last Post: 11-02-2007, 11:50 AM
  4. where are my zimlets ?
    By santo in forum Zimlets
    Replies: 21
    Last Post: 06-05-2007, 07:30 AM
  5. Is it started or not
    By kwelipatton in forum Installation
    Replies: 10
    Last Post: 03-28-2006, 11:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •