[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlrpc-user
Subject:    Re: Using the Built-in HTTP Server
From:       Pedro Braga <pbraga () av ! it ! pt>
Date:       2005-06-24 9:19:06
Message-ID: 42BBD00A.60808 () av ! it ! pt
[Download RAW message or body]

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


[Attachment #3 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body>
Thank you Indra and Holger.<br>
<br>
I guess we can say you save me a month!!!!<br>
<br>
Realy grateful.&nbsp; :) :)<br>
<br>
Pedro Braga.<br>
<br>
<br>
Indra Syafruddin wrote:
<blockquote cite="mid20050624075816.59442.qmail@web51712.mail.yahoo.com"
 type="cite">
  <pre wrap="">you forget server.start(); 
// it is not written in the documentation... I spent 1
month to discover this :-(



--- Pedro Braga <a class="moz-txt-link-rfc2396E" \
href="mailto:pbraga@av.it.pt">&lt;pbraga@av.it.pt&gt;</a> wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">    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.

----------------------- &lt;example&gt;
-----------------------
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
<a class="moz-txt-link-rfc2396E" \
href="http://localhost:8080/RPC2">&lt;http://localhost:8080/RPC2&gt;</a>.  WebServer \
server = new WebServer(8080);  server.addHandler("sample", new
JavaServer());

        } catch (Exception exception) {
            System.err.println("JavaServer: " +
exception.toString());
        }
    }
}

----------------------- &lt;/example&gt;
-----------------------

-- 
Pedro Braga
<a class="moz-txt-link-abbreviated" href="mailto:pbraga@av.it.pt">pbraga@av.it.pt</a>


    </pre>
  </blockquote>
  <pre wrap=""><!---->

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
<a class="moz-txt-link-freetext" \
href="http://mail.yahoo.com">http://mail.yahoo.com</a>   </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Pedro Braga
<a class="moz-txt-link-abbreviated" href="mailto:pbraga@av.it.pt">pbraga@av.it.pt</a>
</pre>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic