Hi,
I have web service client made with Xfire technology, how can i reduce the time
for the service calling timeout? or Is there a way to get a timeout excepction
or to check if there is connection with the web service before calling it in
XFire?
Thank you very much in advance.
I have the following code:
public ArrayList getEstado(String ipNodo, String nombreNodo, String rolNodo,
String usuarioRed) {
//el resultado es un ArrayList con la primera posicion para el nombre del nodo
y la segunda para el estado
ArrayList resultado = new ArrayList();
String estado = "0";
Service srvcModel = new ObjectServiceFactory().create(IGetEstado.class);
XFireProxyFactory factory = new
XFireProxyFactory(XFireFactory.newInstance().getXFire());
String URLservicio = "http://" + ipNodo +
"/config_pruebas2/services/GetEstado";
try {
IGetEstado srvc = (IGetEstado)factory.create(srvcModel, URLservicio);
Client client = ((XFireProxy) Proxy.getInvocationHandler(srvc)).getClient();
client.addOutHandler(new DOMOutHandler());
Properties properties = new Properties();
//Action to perform : user token
properties.setProperty(WSHandlerConstants.ACTION,
WSHandlerConstants.USERNAME_TOKEN);
// Password type : plain text
properties.setProperty(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
// for hashed password use:
//properties.setProperty(WSHandlerConstants.PASSWORD_TYPE,
WSConstants.PW_DIGEST);
// User name to send
properties.setProperty(WSHandlerConstants.USER, "serveralias");
// Callback used to retrive password for given user.
properties.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
PasswordHandler.class.getName());
client.addOutHandler(new WSS4JOutHandler(properties));
estado = srvc.recargar(rolNodo, usuarioRed);
resultado.add(nombreNodo);
resultado.add(estado);
return resultado;
} catch (MalformedURLException e) {
e.printStackTrace();
resultado.add(nombreNodo);
resultado.add("ERROR DE CONEXION");
return resultado;
}
______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com