ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Indra Syafruddin <indra_syafrud...@yahoo.com>
Subject Re: Using the Built-in HTTP Server
Date Fri, 24 Jun 2005 07:58:16 GMT
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 

Mime
View raw message