javax.jws web services signed without an application server. Standalone

by MIGUEL ANGEL GONZALEZ PINTO   Last Updated September 11, 2019 17:26 PM

I have some web services created in a standalone project, and I need to implement a security certificate, a signature on the body and a timestamp, but I have not been able to find documentation about it, since all I see is with Axis2 (it needs application container ).

Do you have any ideas or documents about this.

Next, I show code snippets in the implementation of web services.

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

@WebService
public class oficinasWebservices {

    private CoordinadorWAS coordinadorWAS = CoordinadorWAS.getInstance();
    AdministradorOficinasWAS administradorOficinasWAS = AdministradorOficinasWAS.getInstance();

    @WebMethod
    public List<DatosOficinaGUI> getoficinas(@WebParam(name = "getColeccion") String getColeccion) {
        List<DatosOficinaGUI> response = new ArrayList<DatosOficinaGUI>();
        response = coordinadorWAS.getOficinas(getColeccion);
        return response;
    }

    @WebMethod
    public OficinaWAS getoficina(@WebParam(name = "idOficina") int idOficina) {
        OficinaWAS response;
        response = (OficinaWAS) administradorOficinasWAS.getOficina(idOficina);
        return response;
    }

    @WebMethod
    public String subirOficinas(@WebParam(name = "idCoordinador") int idCoordinador,
                                @WebParam(name = "oficinas") Vector<Integer> oficinas,
                                @WebParam(name = "usuario") String usuario) throws ErroresGeneralesException {
        String response = "";

        try {

            coordinadorWAS.subirOficinas(idCoordinador, oficinas, usuario);

            response = MensajesLog.getInstance().get("mensaje.was.presentacion.cw.024", null);
        } catch (ErroresGeneralesException e) {
            throw (new ErroresGeneralesException(oficinas.toString(), "Error en el Server Subiendo las Oficinas"));
        } catch (Exception e) {
            throw (new ErroresGeneralesException(oficinas.toString(),
                                                 MensajesLog.getInstance()
                                                 .get("mensaje.was.presentacion.cw.error.018", null)));
        }

        return response;
    }

}

in the main:

private static void subirServiciosWeb() {
        puerto = "8081";
        InetAddress inetAddress;

        try {
            inetAddress = InetAddress.getLocalHost();
            ip = inetAddress.getHostAddress().toString();
        } catch (UnknownHostException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        // Servicios oficinas
        Endpoint.publish("http://" + ip + ":" + puerto + "/WSBA_CanalOficinas_administrarOficinas",
        new oficinasWebservices());
}

Thanks



Related Questions


Updated February 15, 2018 00:26 AM

Updated July 11, 2019 04:26 AM

Updated May 14, 2018 01:26 AM

Updated January 09, 2018 04:26 AM

Updated August 23, 2017 20:26 PM