ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pedro Braga <pbr...@av.it.pt>
Subject Re: Using the Built-in HTTP Server
Date Fri, 24 Jun 2005 09:19:06 GMT
Thank you Indra and Holger.

I guess we can say you save me a month!!!!

Realy grateful.  :) :)

Pedro Braga.


Indra Syafruddin wrote:

>you forget server.start(); 
>// it is not written in the documentation... I spent 1
>month to discover this :-(
>
>
>
>--- Pedro Braga <pbraga@av.it.pt> wrote:
>
>  
>
>>    Hello All,
>>
>>
>>I'm trying to use a built-in HTTP Server to "export"
>>some methods.
>>
>>I just start with an example I found on the Net.
>>It was from the time of "helma.xmlrpc.*" as you can
>>see on the code. I 
>>changed to org.apache.xmlrpc.*
>>
>>When I run the program it just starts and ends
>>immediately without error!?!?
>>
>>Can you help me, please?
>>
>>Thanks in advance.
>>
>>----------------------- <example>
>>-----------------------
>>import java.util.Hashtable;
>>//import helma.xmlrpc.*;
>>import org.apache.xmlrpc.*;
>>
>>
>>public class JavaServer {
>>
>>    public JavaServer () {
>>        // Our handler is a regular Java object. It
>>can have a
>>        // constructor and member variables in the
>>ordinary fashion.
>>        // Public methods will be exposed to XML-RPC
>>clients.
>>    }
>>
>>    public Hashtable sumAndDifference (int x, int y)
>>{
>>        Hashtable result = new Hashtable();
>>        result.put("sum", new Integer(x + y));
>>        result.put("difference", new Integer(x -
>>y));
>>        return result;
>>    }
>>
>>    public static void main (String [] args) {
>>        try {
>>           
>>            // Invoke me as
>><http://localhost:8080/RPC2>.
>>            WebServer server = new WebServer(8080);
>>            server.addHandler("sample", new
>>JavaServer());
>>
>>        } catch (Exception exception) {
>>            System.err.println("JavaServer: " +
>>exception.toString());
>>        }
>>    }
>>}
>>
>>----------------------- </example>
>>-----------------------
>>
>>-- 
>>Pedro Braga
>>pbraga@av.it.pt
>>
>>
>>    
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>  
>


-- 
Pedro Braga
pbraga@av.it.pt


Mime
View raw message