Como la inicialización del servicio del cliente WS y el puerto tardan años, me gusta inicializarlos una vez al inicio y volver a usar la misma instancia del puerto. Initalization sería algo como esto:¿Es seguro este subproceso de llamada de cliente JAX-WS?
private static RequestContext requestContext = null;
static
{
MyService service = new MyService();
MyPort myPort = service.getMyServicePort();
Map<String, Object> requestContextMap = ((BindingProvider) myPort).getRequestContext();
requestContextMap = ((BindingProvider)myPort).getRequestContext();
requestContextMap.put(BindingProvider.USERNAME_PROPERTY, uName);
requestContextMap.put(BindingProvider.PASSWORD_PROPERTY, pWord);
rc = new RequestContext();
rc.setApplication("test");
rc.setUserId("test");
}
La llamada en algún lugar de mi clase:
myPort.someFunctionCall(requestContext, "someValue");
Mi pregunta: ¿Será esta llamada ser flujos seguros?
Jonny
ya ha sido contestada aquí: http://stackoverflow.com/questions/4385204/are-jax-ws-clients-thread-safe – kyiu
Hola KHY , Gracias por su respuesta rápida. Vi este hilo. Mi problema es que no tengo ninguna declaración (oficial) que sea segura o no (service/port/etc.). Mi uso también difiere del otro hilo. Jonny – user871611
Aquí una respuesta que encontré en el sitio web de CXF: https://cwiki.apache.org/CXF/faq.html#FAQ-AreJAXWSclientproxiesthreadsafe%253F – kyiu