xml_Q
"mastere_iag2004" <[email protected]>
| Newsgroups | gmane.text.xml.rpc.specification |
|---|---|
| Message-ID | <[email protected]> |
Hello,
Can a person tell me in this communication :
********code java client*************
import org.apache.xmlrpc.*;
import java.util.Vector;
public class client {
public client() {
}
public static void main (String args[]){
methode1("127.0.0.1","1111");
}
public static void methode1(String servName, String servPort) {
String url = "http://"+servName+":"+servPort;
try{
// declaration du client xmlrpc.
XmlRpcClient xmlrpc = new XmlRpcClientLite(url);
// passage de paramètres
Vector parameter = new Vector ();
parameter.addElement (" abc ");
// execution de la requete côté serveur et recuperation du
resultat
String results =(String) xmlrpc.execute
("serv.traitChaine", parameter);
// affichage du resultat
System.out.println("resultat : "+results);
}
catch (java.net.MalformedURLException badAddress){
badAddress.printStackTrace( System.out);
}
catch (java.io.IOException connectionProblem){
connectionProblem.printStackTrace( System.out);
}
catch (XmlRpcException serverProblem){
serverProblem.printStackTrace( System.out);
}
}
}
*******code java server*********
package textxmlrpc;
import org.apache.xmlrpc.*;
import java.util.Vector;
public class serveur {
public serveur() {
}
// methode distante sur le serveur a invoquée par les clients.
public String traitChaine(String chaine) {
String result;
result = chaine+" Traitee ";
return result;
}
public static WebServer startServer() {
try {
System.out.println("Starting server on port 1111");
// instantiation du serveur
WebServer xmlrpcServer = new WebServer(1111);
// ajout d'un serveur
xmlrpcServer.addHandler("serv", new serveur());
// demarrage du serveur
xmlrpcServer.start();
System.out.println("server running");
return xmlrpcServer;
} catch (Exception webServerStartError) {
System.err.println("JavaServer : " +
webServerStartError.toString());
return null;
}
}
public static void main(String[] args) {
startServer();
}
}
how I can visualize this xml code:
<methodCall>
<methodName> serv.traitChaine </methodName>
<params>
<param><value> abc </value></param>
</params>
</methodCall>
and if the xml is stored in temporary file or in memory when I
execute the codes of server and client ?
I hope that my questions are clears, Thinks for your reply
Inesse
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/xml-rpc/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/