Search in sources :

Example 61 with WebMethod

use of javax.jws.WebMethod in project bamboobsc by billchen198318.

the class ApiWebServiceImpl method getScorecard1.

/**
	 * SOAP 請使用 SoapUI 來測試
	 * ==================================================================================
		<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.bsc.greenstep.netsteadfast.com/">
		   <soapenv:Header/>
		   <soapenv:Body>
		   
		      <web:getScorecard1>
		      
		         <visionOid>1089abb5-3faf-445d-88ff-cd7690ac6743</visionOid>
		         <startDate></startDate>
		         <endDate></endDate>
		         <startYearDate>2015</startYearDate>
		         <endYearDate>2016</endYearDate>
		         <frequency>6</frequency>
		         <dataFor>all</dataFor>
		         <measureDataOrganizationOid></measureDataOrganizationOid>
		         <measureDataEmployeeOid></measureDataEmployeeOid>
		         <contentFlag></contentFlag>
		         
		      </web:getScorecard1>
		      
		   </soapenv:Body>
		</soapenv:Envelope>
	 * ==================================================================================
	 * 
	 * 
	 * REST 範例:
	 * curl -i -X GET "http://127.0.0.1:8080/gsbsc-web/services/jaxrs/scorecard1?visionOid=1089abb5-3faf-445d-88ff-cd7690ac6743&startDate=&endDate=&startYearDate=2015&endYearDate=2016&frequency=6&dataFor=all&measureDataOrganizationOid=&measureDataEmployeeOid=&contentFlag="
	 * 
	 */
@WebMethod
@GET
@Path("/scorecard1/")
@Override
public BscApiServiceResponse getScorecard1(@WebParam(name = "visionOid") @QueryParam("visionOid") String visionOid, @WebParam(name = "startDate") @QueryParam("startDate") String startDate, @WebParam(name = "endDate") @QueryParam("endDate") String endDate, @WebParam(name = "startYearDate") @QueryParam("startYearDate") String startYearDate, @WebParam(name = "endYearDate") @QueryParam("endYearDate") String endYearDate, @WebParam(name = "frequency") @QueryParam("frequency") String frequency, @WebParam(name = "dataFor") @QueryParam("dataFor") String dataFor, @WebParam(name = "measureDataOrganizationOid") @QueryParam("measureDataOrganizationOid") String measureDataOrganizationOid, @WebParam(name = "measureDataEmployeeOid") @QueryParam("measureDataEmployeeOid") String measureDataEmployeeOid, @WebParam(name = "contentFlag") @QueryParam("contentFlag") String contentFlag) throws Exception {
    HttpServletRequest request = null;
    if (this.getWebServiceContext() != null && this.getWebServiceContext().getMessageContext() != null) {
        request = (HttpServletRequest) this.getWebServiceContext().getMessageContext().get(MessageContext.SERVLET_REQUEST);
    }
    Subject subject = null;
    BscApiServiceResponse responseObj = new BscApiServiceResponse();
    responseObj.setSuccess(YesNo.NO);
    try {
        subject = WsAuthenticateUtils.login();
        this.processForScorecard(responseObj, request, visionOid, startDate, endDate, startYearDate, endYearDate, frequency, dataFor, measureDataOrganizationOid, measureDataEmployeeOid, contentFlag);
    } catch (Exception e) {
        responseObj.setMessage(e.getMessage());
    } finally {
        if (!YesNo.YES.equals(responseObj.getSuccess())) {
            responseObj.setMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
        }
        WsAuthenticateUtils.logout(subject);
    }
    subject = null;
    return responseObj;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) BscApiServiceResponse(com.netsteadfast.greenstep.bsc.vo.BscApiServiceResponse) Subject(org.apache.shiro.subject.Subject) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) WebMethod(javax.jws.WebMethod) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 62 with WebMethod

use of javax.jws.WebMethod in project opentheso by miledrousset.

the class Soap method multiConceptToSkos.

/**
 * Web service operation
 * @param value
 * @param idThesaurus
 * @param lang
 * @return
 */
@WebMethod(operationName = "multiConceptToSkos")
public String multiConceptToSkos(@WebParam(name = "value") String value, @WebParam(name = "idThesaurus") String idThesaurus, @WebParam(name = "lang") String lang) {
    if (ds == null)
        return null;
    if (prefs == null)
        return null;
    ExportFromBDD exportFromBDD = new ExportFromBDD();
    exportFromBDD.setServerArk(prefs.getProperty("serverArk"));
    exportFromBDD.setServerAdress(prefs.getProperty("cheminSite"));
    String skos = exportFromBDD.exportMultiConcept(ds, idThesaurus, value, lang).toString();
    return skos;
}
Also used : ExportFromBDD(mom.trd.opentheso.core.exports.old.ExportFromBDD) WebMethod(javax.jws.WebMethod)

Example 63 with WebMethod

use of javax.jws.WebMethod in project trainning by fernandotomasio.

the class AtividadesDeEnsinoService method findAllIndicacoesAlunoByPessoaId.

@WebMethod(operationName = "findAllIndicacoesAlunoByPessoaId")
public IndicacaoDTO[] findAllIndicacoesAlunoByPessoaId(@WebParam(name = "exercicio") int exercicio, @WebParam(name = "pessoaId") Long pessoaId) {
    SimpleDateFormat df = new SimpleDateFormat("yyyy");
    Date exercicioDate = null;
    try {
        exercicioDate = df.parse(String.valueOf(exercicio));
    } catch (ParseException ex) {
        Logger.getLogger(AtividadesDeEnsinoService.class.getName()).log(Level.SEVERE, null, ex);
    }
    IndicacaoDTO[] indicacoes = atividadesEnsinoService.findAllIndicacoesAlunoByPessoaId(exercicioDate, pessoaId);
    return indicacoes;
}
Also used : ParseException(java.text.ParseException) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) IndicacaoDTO(com.tomasio.projects.trainning.dto.IndicacaoDTO) WebMethod(javax.jws.WebMethod)

Example 64 with WebMethod

use of javax.jws.WebMethod in project trainning by fernandotomasio.

the class AtividadesDeEnsinoService method findAllConcluidosByOrganizacao.

@WebMethod(operationName = "findAllConcluidosByOrganizacao")
public ConclusaoDTO[] findAllConcluidosByOrganizacao(@WebParam(name = "organizacaoId") Long organizacaoId, @WebParam(name = "capacitacaoId") Long capacitacaoId) {
    List<ConclusaoDTO> concluidosList = new ArrayList<>();
    ConclusaoDTO[] concluidos = atividadesEnsinoService.findAllConcluidosByOrganizacao(organizacaoId, capacitacaoId, true);
    for (ConclusaoDTO concluido : concluidos) {
        if (concluido.getPessoa().isAtivo()) {
            concluidosList.add(concluido);
        }
    }
    ConclusaoDTO[] result = new ConclusaoDTO[concluidosList.size()];
    concluidosList.toArray(result);
    return result;
}
Also used : ConclusaoDTO(com.tomasio.projects.trainning.dto.ConclusaoDTO) ArrayList(java.util.ArrayList) WebMethod(javax.jws.WebMethod)

Example 65 with WebMethod

use of javax.jws.WebMethod in project trainning by fernandotomasio.

the class AtividadesDeEnsinoService method findAllConcluidos.

@WebMethod(operationName = "findAllConcluidos")
public ConclusaoDTO[] findAllConcluidos(@WebParam(name = "organizacaoId") Long organizacaoId, @WebParam(name = "capacitacaoId") Long capacitacaoId, @WebParam(name = "turmaId") Long turmaId, @WebParam(name = "pessoaId") Long pessoaId, @WebParam(name = "includeSubordinadas") boolean includeSubordinadas) {
    List<ConclusaoDTO> concluidosList = new ArrayList<>();
    Long[] organizacoesIds = null;
    if (organizacaoId != null) {
        if (includeSubordinadas) {
            OrganizacaoDTO[] subordinadas = organizationalService.findAllOrganizacoesSubordinadas(organizacaoId);
            organizacoesIds = new Long[subordinadas.length + 1];
            for (int i = 0; i < subordinadas.length; i++) {
                organizacoesIds[i] = subordinadas[i].getId();
            }
            organizacoesIds[subordinadas.length] = organizacaoId;
        } else {
            organizacoesIds = new Long[1];
            organizacoesIds[0] = organizacaoId;
        }
    }
    ConclusaoDTO[] concluidos = atividadesEnsinoService.findAllConcluidos(organizacoesIds, capacitacaoId, turmaId, pessoaId, true);
    for (ConclusaoDTO concluido : concluidos) {
        if (concluido.getPessoa().isAtivo()) {
            concluidosList.add(concluido);
        }
    }
    ConclusaoDTO[] result = new ConclusaoDTO[concluidosList.size()];
    concluidosList.toArray(result);
    return result;
}
Also used : ConclusaoDTO(com.tomasio.projects.trainning.dto.ConclusaoDTO) ArrayList(java.util.ArrayList) OrganizacaoDTO(com.tomasio.projects.trainning.dto.OrganizacaoDTO) WebMethod(javax.jws.WebMethod)

Aggregations

WebMethod (javax.jws.WebMethod)107 Method (java.lang.reflect.Method)18 Path (javax.ws.rs.Path)17 IOException (java.io.IOException)16 WebResult (javax.jws.WebResult)13 MessageContext (javax.xml.ws.handler.MessageContext)12 WebServiceException (javax.xml.ws.WebServiceException)11 Test (org.junit.Test)10 DataHandler (javax.activation.DataHandler)9 GET (javax.ws.rs.GET)9 Action (javax.xml.ws.Action)9 ArrayList (java.util.ArrayList)8 Oneway (javax.jws.Oneway)8 POST (javax.ws.rs.POST)8 File (java.io.File)7 InputStream (java.io.InputStream)6 HttpServletRequest (javax.servlet.http.HttpServletRequest)6 QName (javax.xml.namespace.QName)6 RequestWrapper (javax.xml.ws.RequestWrapper)6 AbstractCodeGenTest (org.apache.cxf.tools.wsdlto.AbstractCodeGenTest)6