ajuda com Apache RPC-XML  XML
Índice dos Fóruns » Ferramentas, Frameworks e Utilitários
Autor Mensagem
javaxxx
Smalltalk

Membro desde: 19/03/2010 09:47:40
Mensagens: 2
Offline

Como eu passo esses valores para o Sevidor responder com usando o projeto apache XML-RPC?

<?xml version="1.0"?>
<methodCall>
<methodName>Event.PEGA_VARIOS_EVENTOS</methodName>
<params>
<param>
<value><struct>
<member><name>DISPOSITIVO</name>
<value><string>7144,7377,7147</string></value>
</member>
<member><name>SENHA_DISPOSITIVO</name>
<value><string>4222</string></value>
</member>
<member><name>NUMERO_EVENTO</name>
<value><string>0</string></value>
</member>
</struct></value>
</param>
</params>
</methodCall>



minha classe cliente !!

obs: é assim que eu passo os parametro ou tenho que montar o xml propriamente dito e passar ele?
alguem pode me dar uma luz?


public ClienteXmlRpc() {
try {
XmlRpcClientConfigImpl confCliente = new XmlRpcClientConfigImpl();
confCliente.setServerURL(new URL(URL_SERVER));
confCliente.setEncoding("UTF-8");
confCliente.setEnabledForExceptions(true);
xmlrpc = new XmlRpcClient();
xmlrpc.setConfig(confCliente);
} catch (Exception exception) {
exception.printStackTrace();
}
}

public Object executar(String comando, Object[] parametros) {
try {
Object resposta = xmlrpc.execute(comando, parametros);
return resposta;
} catch (XmlRpcException e) {
e.printStackTrace();
return null;
}
}

public static void main(String[] args) {
ClienteXmlRpc cliente = new ClienteXmlRpc();
Object[] params = new Object[] {"DISPOSITIVO", new String("2001,2002,2003"),"SENHA_DISPOSITIVO",new String("4567"), "NUMERO_EVENTO",new String("0") };
Vector resp = (Vector) cliente.executar("Event.PEGA_VARIOS_EVENTOS",params);

}


 
Índice dos Fóruns » Ferramentas, Frameworks e Utilitários
Ir para:   
Powered by JForum 2.1.8 © JForum Team