JAX-WS: Seguridad a nivel de contenedor en Weblogic
Aug 08, 10 by Juan Lebrijo about SoapUI, Web Services, weblogic, blog
Para el post de hoy vamos a ver como se asegura un Servicio Web con HTTP Auth, básica, en Weblogic. Para ello nos podemos basar en un proyecto anterior en el que creamos un WS muy básico: Hello World. En el Security Realm > MyRealm tenemos que crear:
  • Usuario: user/12345678
  • Grupo: TutorialUser
  • Añadir el usuario al grupo
En la consola de Weblogic, como vemos en la figura:
manage_users_groups.thumbnail.png 11.4 KB
En el web.xml hay que añadir la configuración de seguridad pertinente (path, tipo básico,....):
   
    
        Regla01
        
            WSPOST
            
            /*
            POST
        
        
            
            TutorialUser
        
    
    
        5
    
    
        BASIC
        myrealm
    
    
        
        TutorialUser
    
Y en el weblogic.xml mapeamos con el rol (si no hacemos esto no funcionará):
    
        TutorialUser
        TutorialUser
    
Podemos probarlo con SoapUI creando un nuevo proyecto de WS, con la dirección del WSDL (http://localhost:7001/wsc/HelloService?WSDL) y las credenciales creadas en WebLogic anteriormente:
1007.thumbnail.gif 7.87 KB
JAX-WS: Servir Web Services SOAP
Aug 04, 10 by Juan Lebrijo about Web Services, spring, weblogic, Eclipse, blog
Hoy crearemos un servicio web SOAP, basándonos en el proyecto LebrijoSchool que hemos venido haciendo sobre la arquitectura Oracle-Weblogic en artículos anteriores. Lo primero es añadir el facet de Web Services. Botón derecho > Properties ... :
add_ws_facet.thumbnail.png 9.14 KB
Después, creamos el WS a partir de una clase de servicio de Spring. Botón derecho > New > WebLogic Web Service for Spring Beans:
expose_spring_as_ws.thumbnail.png 6.69 KB
Elegimos el servicio, y los métodos que queremos publicar publicar como WS. Finalmente lo ponemos en el paquete adecuado: lebrijo.school.webservices. Y le damos un nombre "SchoolCertificatesWS". Nos queda un WS con este código:
	@Autowired
	@Qualifier("RegistryService")
	private IRegistryService springServ;

	@WebMethod
	public Registry findRegistryById(java.lang.String id) throws Exception {
		return springServ.findRegistryById( id );
	}
Para ver como funciona en WS tenemos un cliente en Weblogic, al que podemos acceder a través de la URL http://localhost:7001/wls_utc/.
JAX-WS: Serving Web Services SOAP
Aug 04, 10 by Juan Lebrijo about Web Services, spring, weblogic, Eclipse, blog
Today we will create a SOAP Web Service, based on LebrijoSchool project which we were making in early weeks over Oracle-Weblogic Architechture. First of all is to add the Web Services facet. Right button > Properties ... :
add_ws_facet.thumbnail.png 9.14 KB
After, we will create the class from a Spring Service class. Right button > New > WebLogic Web Service for Spring Beans:
expose_spring_as_ws.thumbnail.png 6.69 KB
Choose the Service, and the methods that we want to publish as Web Service. Finally put it in the logical package: lebrijo.school.webservices. And name it as "SchoolCertificatesWS". This is the code:
	@Autowired
	@Qualifier("RegistryService")
	private IRegistryService springServ;

	@WebMethod
	public Registry findRegistryById(java.lang.String id) throws Exception {
		return springServ.findRegistryById( id );
	}
We have a Weblogic client to test the WS, we can acces thru the URL http://localhost:7001/wls_utc/.