javax.jws.WebMethod Java Examples

The following examples show how to use javax.jws.WebMethod. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SakaiConfiguration.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
/**
 * @param sessionid
 * @param propNames - comma separated list of property names
 * @return
 */
@WebMethod
@Path("/getProperties")
@Produces("text/plain")
@GET
public String getProperties(
        @WebParam(name = "sessionid", partName = "sessionid") @QueryParam("sessionid") String sessionid,
        @WebParam(name = "propNames", partName = "propNames") @QueryParam("propNames") String propNames) {
    Session session = establishSession(sessionid);
    if (!securityService.isSuperUser()) {
        log.warn("NonSuperUser trying to collect configuration: " + session.getUserId());
        throw new RuntimeException("NonSuperUser trying to collect configuration: " + session.getUserId());
    }
    String[] propNamesArray = propNames.split(",");
    Map<String, String> propertyMap = new HashMap();
    for (int i = 0; i < propNamesArray.length; i++) {
        String propValue = lookupConfigValue(propNamesArray[i]);
        String propName = propNamesArray[i].trim().replace("@", "-").replace(".", "_");
        propertyMap.put(propName, propValue);
    }
    log.debug(getXML("properties", propertyMap));
    return getXML("properties", propertyMap);

}
 
Example #2
Source File: Activity.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
/**
 * Returns a list of events of a user between 2 dates. As this one requires 2 Date objects,
 * it is the one to be called as a normal webservice.
 * @param eid	is the user that we want to query
 * @param startDate limit the query ti these dates
 * @param endDate limit the query ti these dates
 * @return	String as the result of the Query in xml
 */
@WebMethod
@Path("/getUserActivity")
@Produces("text/plain")
@GET
public String getUserActivity(
        @WebParam(name = "sessionid", partName = "sessionid") @QueryParam("sessionid") String sessionid,
        @WebParam(name = "eid", partName = "eid") @QueryParam("eid") String eid,
        @WebParam(name = "startDate", partName = "startDate") @QueryParam("startDate") Date startDate,
        @WebParam(name = "endDate", partName = "endDate") @QueryParam("endDate") Date endDate) {

    Session session = establishSession(sessionid);

    if (!securityService.isSuperUser()) {
        log.warn("WS getUserActivity(): Permission denied. Restricted to super users.");
        throw new RuntimeException("WS getUserActivity(): Permission denied. Restricted to super users.");
    }

    return eventQueryService.getUserActivity(eid, startDate, endDate);
}
 
Example #3
Source File: RoomWebService.java    From openmeetings with Apache License 2.0 6 votes vote down vote up
/**
 * Method to remotely close rooms. If a room is closed all users
 * inside the room and all users that try to enter it will be redirected to
 * the redirectURL that is defined in the ROOM-Object.
 *
 * Returns positive value if authentication was successful.
 *
 * @param sid
 *            The SID of the User. This SID must be marked as Loggedin
 * @param id
 *            the room id
 *
 * @return - 1 in case of success, -2 otherwise
 */
@WebMethod
@GET
@Path("/close/{id}")
public ServiceResult close(@WebParam(name="sid") @QueryParam("sid") String sid, @WebParam(name="id") @PathParam("id") long id) {
	return performCall(sid, User.Right.SOAP, sd -> {
		Long userId = sd.getUserId();
		Room room = roomDao.get(id);
		room.setClosed(true);

		roomDao.update(room, userId);

		WebSocketHelper.sendRoom(new RoomMessage(room.getId(), userDao.get(userId),  RoomMessage.Type.ROOM_CLOSED));

		return new ServiceResult("Closed", Type.SUCCESS);
	});
}
 
Example #4
Source File: JavaMethodImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void setWsaActions(MetadataReader metadataReader) {
    Action action = (metadataReader != null)? metadataReader.getAnnotation(Action.class, seiMethod):seiMethod.getAnnotation(Action.class);
    if(action != null) {
        inputAction = action.input();
        outputAction = action.output();
    }

    //@Action(input) =="", get it from @WebMethod(action)
    WebMethod webMethod = (metadataReader != null)? metadataReader.getAnnotation(WebMethod.class, seiMethod):seiMethod.getAnnotation(WebMethod.class);
    soapAction = "";
    if (webMethod != null )
        soapAction = webMethod.action();
    if(!soapAction.equals("")) {
        //non-empty soapAction
        if(inputAction.equals(""))
            // set input action to non-empty soapAction
            inputAction = soapAction;
        else if(!inputAction.equals(soapAction)){
            //both are explicitly set via annotations, make sure @Action == @WebMethod.action
            //http://java.net/jira/browse/JAX_WS-1108
          //throw new WebServiceException("@Action and @WebMethod(action=\"\" does not match on operation "+ method.getName());
        }
    }
}
 
Example #5
Source File: AwardAccountService.java    From kfs with GNU Affero General Public License v3.0 5 votes vote down vote up
@WebResult(name = "return", targetNamespace = "")
@RequestWrapper(localName = "getAwardAccounts", targetNamespace = KcConstants.KC_NAMESPACE_URI, className = "kc.GetAwardAccounts")
@WebMethod
@ResponseWrapper(localName = "getAwardAccountsResponse", targetNamespace = KcConstants.KC_NAMESPACE_URI, className = "kc.GetAwardAccountsResponse")
public java.util.List<AwardAccountDTO> getAwardAccounts(
    @WebParam(name = "financialAccountNumber", targetNamespace = "")                
    java.lang.String financialAccountNumber,
    @WebParam(name = "chartOfAccounts", targetNamespace = "")
    java.lang.String chartOfAccounts
);
 
Example #6
Source File: KewTypeRepositoryService.java    From rice with Educational Community License v2.0 5 votes vote down vote up
/**
 * Returns all KEW types that for a given namespace.
 *
 * @return all KEW types for a namespace
 */
@WebMethod(operationName = "findAllTypesByNamespace")
@WebResult(name = "namespaceTypes")
@XmlElementWrapper(name = "namespaceTypes", required = false)
@XmlElement(name = "namespaceType", required = false)
List<KewTypeDefinition> findAllTypesByNamespace(
        @WebParam(name = "namespace") String namespace) throws RiceIllegalArgumentException;
 
Example #7
Source File: DocumentTypeService.java    From rice with Educational Community License v2.0 5 votes vote down vote up
@WebMethod(operationName = "canSuperUserApproveDocument")
@WebResult(name = "isSuperUser")
@XmlElement(name = "isSuperUser", required = true)
boolean canSuperUserApproveDocument(
        @WebParam(name = "principalId") String principalId,
        @WebParam(name = "documentTypeName") String documentTypeName,
        @WebParam(name = "routeNodeInstances") List<RouteNodeInstance> routeNodeInstances,
        @WebParam(name = "routeStatusCode") String routeStatusCode)
        throws RiceIllegalArgumentException;
 
Example #8
Source File: DeviceIOPort.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
 * Modify a video input configuration. A device that has one or more video
 *         sources shall support the setting of the VideoSourceConfiguration through this command.
 *       
 */
@WebMethod(operationName = "SetVideoSourceConfiguration", action = "http://www.onvif.org/ver10/deviceio/wsdl/SetVideoSourceConfiguration")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "SetVideoSourceConfigurationResponse", targetNamespace = "http://www.onvif.org/ver10/deviceIO/wsdl", partName = "parameters")
public SetVideoSourceConfigurationResponse setVideoSourceConfiguration(

    @WebParam(partName = "parameters", name = "SetVideoSourceConfiguration", targetNamespace = "http://www.onvif.org/ver10/deviceIO/wsdl")
    SetVideoSourceConfiguration parameters
);
 
Example #9
Source File: WorkflowService.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
@WebMethod
public byte[] getProcessDefinitionImage(@WebParam(name = "token") String token, @WebParam(name = "pdId") long pdId,
                                        @WebParam(name = "node") String node) throws AccessDeniedException, RepositoryException, DatabaseException, WorkflowException {
	log.debug("getProcessDefinitionImage({}, {}, {})", new Object[]{token, pdId, node});
	WorkflowModule wm = ModuleManager.getWorkflowModule();
	byte[] result = wm.getProcessDefinitionImage(token, pdId, node);
	log.debug("getProcessDefinitionImage: {}", result);
	return result;
}
 
Example #10
Source File: TIPPortType.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@WebMethod(
   action = "urn:be:fgov:ehealth:gfddpp:protocol:v1:UpdateData"
)
@WebResult(
   name = "UpdateDataResponse",
   targetNamespace = "urn:be:fgov:ehealth:gfddpp:protocol:v1",
   partName = "body"
)
SimpleResponseType updateData(@WebParam(name = "UpdateDataRequest",targetNamespace = "urn:be:fgov:ehealth:gfddpp:protocol:v1",partName = "body") SealedMessageRequestType var1) throws SystemError_Exception;
 
Example #11
Source File: Media.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
 * If the profile token is already known, a profile can be fetched through
 *         the GetProfile command.
 *       
 */
@WebMethod(operationName = "GetProfile", action = "http://www.onvif.org/ver10/media/wsdlGetProfile/")
@RequestWrapper(localName = "GetProfile", targetNamespace = "http://www.onvif.org/ver10/media/wsdl", className = "org.onvif.ver10.media.wsdl.GetProfile")
@ResponseWrapper(localName = "GetProfileResponse", targetNamespace = "http://www.onvif.org/ver10/media/wsdl", className = "org.onvif.ver10.media.wsdl.GetProfileResponse")
@WebResult(name = "Profile", targetNamespace = "http://www.onvif.org/ver10/media/wsdl")
public org.onvif.ver10.schema.Profile getProfile(

    @WebParam(name = "ProfileToken", targetNamespace = "http://www.onvif.org/ver10/media/wsdl")
    java.lang.String profileToken
);
 
Example #12
Source File: SakaiReport.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
@WebMethod
@Path("/executeQuery2")
@Produces("text/plain")
@GET
public String executeQuery2(
        @WebParam(name = "sessionid", partName = "sessionid") @QueryParam("sessionid") String sessionid,
        @WebParam(name = "query", partName = "query") @QueryParam("query") String query,
        @WebParam(name = "hash", partName = "hash") @QueryParam("hash") String hash,
        @WebParam(name = "rowCount", partName = "rowCount") @QueryParam("rowCount") int rowCount,
        @WebParam(name = "format", partName = "format") @QueryParam("format") String format) {
    return executeQueryInternal(sessionid, query, hash, rowCount, convertFormatToEnum(format));
}
 
Example #13
Source File: DisplayPort.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
     * Returns the capabilities of the display service. The result is returned in
     *         a typed answer.
     *       
     */
    @WebMethod(operationName = "GetServiceCapabilities", action = "http://www.onvif.org/ver10/display/wsdl/GetServiceCapabilities")
    @RequestWrapper(localName = "GetServiceCapabilities", targetNamespace = "http://www.onvif.org/ver10/display/wsdl", className = "org.onvif.ver10.display.wsdl.GetServiceCapabilities")
    @ResponseWrapper(localName = "GetServiceCapabilitiesResponse", targetNamespace = "http://www.onvif.org/ver10/display/wsdl", className = "org.onvif.ver10.display.wsdl.GetServiceCapabilitiesResponse")
    @WebResult(name = "Capabilities", targetNamespace = "http://www.onvif.org/ver10/display/wsdl")
    public org.onvif.ver10.display.wsdl.Capabilities getServiceCapabilities()
;
 
Example #14
Source File: ExecutorServices.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@RequestWrapper(
   localName = "markAsArchived",
   targetNamespace = "http://services.recipe.be",
   className = "be.recipe.services.MarkAsArchived"
)
@WebMethod
@ResponseWrapper(
   localName = "markAsArchivedResponse",
   targetNamespace = "http://services.recipe.be",
   className = "be.recipe.services.MarkAsArchivedResponse"
)
void markAsArchived(@WebParam(name = "MarkAsArchivedParamSealed", targetNamespace = "") byte[] var1, @WebParam(name = "PartyIdentificationParam", targetNamespace = "") PartyIdentification var2) throws RecipeException;
 
Example #15
Source File: Device.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
     * Returns the capabilities of the device service. The result is returned in
     *         a typed answer.
     *       
     */
    @WebMethod(operationName = "GetServiceCapabilities", action = "http://www.onvif.org/ver10/device/wsdl/GetServiceCapabilities")
    @RequestWrapper(localName = "GetServiceCapabilities", targetNamespace = "http://www.onvif.org/ver10/device/wsdl", className = "org.onvif.ver10.device.wsdl.GetServiceCapabilities")
    @ResponseWrapper(localName = "GetServiceCapabilitiesResponse", targetNamespace = "http://www.onvif.org/ver10/device/wsdl", className = "org.onvif.ver10.device.wsdl.GetServiceCapabilitiesResponse")
    @WebResult(name = "Capabilities", targetNamespace = "http://www.onvif.org/ver10/device/wsdl")
    public org.onvif.ver10.device.wsdl.DeviceServiceCapabilities getServiceCapabilities()
;
 
Example #16
Source File: DashboardService.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
@WebMethod
public QueryParams[] getUserSearchs(@WebParam(name = "token") String token) throws AccessDeniedException, RepositoryException,
		DatabaseException {
	log.debug("getUserSearchs({})", new Object[]{token});
	DashboardModule dm = ModuleManager.getDashboardModule();
	List<QueryParams> col = dm.getUserSearchs(token);
	QueryParams[] result = col.toArray(new QueryParams[col.size()]);
	log.debug("getUserSearchs: {}", result);
	return result;
}
 
Example #17
Source File: PCDHPortType.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
@WebMethod(
   action = "urn:be:fgov:ehealth:gfddpp:protocol:v1:GetDataTypes"
)
@WebResult(
   name = "GetDataTypesResponse",
   targetNamespace = "urn:be:fgov:ehealth:gfddpp:protocol:v1",
   partName = "body"
)
SealedResponseType getDataTypes(@WebParam(name = "GetDataTypesRequest", targetNamespace = "urn:be:fgov:ehealth:gfddpp:protocol:v1", partName = "body") SealedRequestType var1) throws SystemError_Exception;
 
Example #18
Source File: DashboardService.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
@WebMethod
public DashboardDocumentResult[] getUserLastModifiedDocuments(@WebParam(name = "token") String token)
		throws AccessDeniedException, RepositoryException, DatabaseException {
	log.debug("getUserLastModifiedDocuments({})", new Object[]{token});
	DashboardModule dm = ModuleManager.getDashboardModule();
	List<DashboardDocumentResult> col = dm.getUserLastModifiedDocuments(token);
	DashboardDocumentResult[] result = col.toArray(new DashboardDocumentResult[col.size()]);
	log.debug("getUserLastModifiedDocuments: {}", result);
	return result;
}
 
Example #19
Source File: ReplayPort.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
     * Returns the capabilities of the replay service. The result is returned in
     *         a typed answer.
     *       
     */
    @WebMethod(operationName = "GetServiceCapabilities", action = "http://www.onvif.org/ver10/replay/wsdl/GetServiceCapabilities")
    @RequestWrapper(localName = "GetServiceCapabilities", targetNamespace = "http://www.onvif.org/ver10/replay/wsdl", className = "org.onvif.ver10.replay.wsdl.GetServiceCapabilities")
    @ResponseWrapper(localName = "GetServiceCapabilitiesResponse", targetNamespace = "http://www.onvif.org/ver10/replay/wsdl", className = "org.onvif.ver10.replay.wsdl.GetServiceCapabilitiesResponse")
    @WebResult(name = "Capabilities", targetNamespace = "http://www.onvif.org/ver10/replay/wsdl")
    public org.onvif.ver10.replay.wsdl.Capabilities getServiceCapabilities()
;
 
Example #20
Source File: DashboardService.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
@WebMethod
public DashboardDocumentResult[] getUserLastUploadedDocuments(@WebParam(name = "token") String token)
		throws AccessDeniedException, RepositoryException, DatabaseException {
	log.debug("getUserLastUploadedDocuments({})", new Object[]{token});
	DashboardModule dm = ModuleManager.getDashboardModule();
	List<DashboardDocumentResult> col = dm.getUserLastUploadedDocuments(token);
	DashboardDocumentResult[] result = col.toArray(new DashboardDocumentResult[col.size()]);
	log.debug("getUserLastUploadedDocuments: {}", result);
	return result;
}
 
Example #21
Source File: BookmarkService.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
@WebMethod
public Bookmark get(@WebParam(name = "token") String token, @WebParam(name = "bmId") int bmId)
		throws AccessDeniedException, RepositoryException, DatabaseException {
	log.debug("get({}, {})", new Object[]{token, bmId});
	BookmarkModule bm = ModuleManager.getBookmarkModule();
	Bookmark bookmark = bm.get(token, bmId);
	log.debug("get: {}", bookmark);
	return bookmark;
}
 
Example #22
Source File: ServiceInterface.java    From BIMserver with GNU Affero General Public License v3.0 4 votes vote down vote up
@WebMethod(action = "determineIfcVersion")
String determineIfcVersion(
	@WebParam(name = "head", partName = "determineIfcVersion.head") byte[] head, 
	@WebParam(name = "zipped", partName = "determineIfcVersion.zipped") Boolean zipped) throws UserException, ServiceException;
 
Example #23
Source File: WSTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@WebMethod
public String getMethod1Value() {
    return "from Method1";
}
 
Example #24
Source File: CxfClientPluginIT.java    From glowroot with Apache License 2.0 4 votes vote down vote up
@WebMethod
String hello(@WebParam(name = "text") String text);
 
Example #25
Source File: CalculatePowerWebService.java    From packt-java-ee-7-code-samples with GNU General Public License v2.0 4 votes vote down vote up
@WebMethod
@WebResult(name = "result")
public double calculatePower(@WebParam(name = "base") double base,
                             @WebParam(name = "exponent") double exponent) {
    return Math.pow(base, exponent);
}
 
Example #26
Source File: EPCISServicePortType.java    From fosstrak-epcis with GNU Lesser General Public License v2.1 4 votes vote down vote up
@WebResult(name = "GetStandardVersionResult", targetNamespace = "urn:epcglobal:epcis-query:xsd:1", partName = "getStandardVersionReturn")
@WebMethod
public java.lang.String getStandardVersion(
        @WebParam(partName = "parms", name = "GetStandardVersion", targetNamespace = "urn:epcglobal:epcis-query:xsd:1") org.fosstrak.epcis.model.EmptyParms parms)
        throws ImplementationExceptionResponse, SecurityExceptionResponse, ValidationExceptionResponse;
 
Example #27
Source File: SimpleService.java    From dropwizard-jaxws with Apache License 2.0 4 votes vote down vote up
@WebMethod
@Metered
public String echo(String input) {
    return input;
}
 
Example #28
Source File: WSTest.java    From jolie with GNU Lesser General Public License v2.1 4 votes vote down vote up
@WebMethod( operationName = "sum", action = "tns:sum" )
public Integer sum( @WebParam( name = "x" ) Integer x, @WebParam( name = "y" ) Integer y ) {
	return Calculator.sum( x, y );
}
 
Example #29
Source File: ReportServiceInterface.java    From googleads-java-lib with Apache License 2.0 3 votes vote down vote up
/**
 * 
 *         Returns the URL at which the report file can be downloaded.
 *         <p>
 *         The report will be generated as a gzip archive, containing the report file itself.
 *         
 *         @param reportJobId the ID of the {@link ReportJob}
 *         @param exportFormat the {@link ExportFormat} for the report file
 *         @return the URL for report file download
 *       
 * 
 * @param reportJobId
 * @param exportFormat
 * @return
 *     returns java.lang.String
 * @throws ApiException_Exception
 */
@WebMethod
@WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908")
@RequestWrapper(localName = "getReportDownloadURL", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908", className = "com.google.api.ads.admanager.jaxws.v201908.ReportServiceInterfacegetReportDownloadURL")
@ResponseWrapper(localName = "getReportDownloadURLResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908", className = "com.google.api.ads.admanager.jaxws.v201908.ReportServiceInterfacegetReportDownloadURLResponse")
public String getReportDownloadURL(
    @WebParam(name = "reportJobId", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908")
    Long reportJobId,
    @WebParam(name = "exportFormat", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908")
    ExportFormat exportFormat)
    throws ApiException_Exception
;
 
Example #30
Source File: ForecastServiceInterface.java    From googleads-java-lib with Apache License 2.0 3 votes vote down vote up
/**
 * 
 *         Gets the availability forecast for a {@link ProspectiveLineItem}. An availability forecast
 *         reports the maximum number of available units that the line item can book, and the total number
 *         of units matching the line item's targeting.
 *         
 *         @param lineItem the prospective line item (new or existing) to be forecasted for availability
 *         @param forecastOptions options controlling the forecast
 *       
 * 
 * @param lineItem
 * @param forecastOptions
 * @return
 *     returns com.google.api.ads.admanager.jaxws.v201908.AvailabilityForecast
 * @throws ApiException_Exception
 */
@WebMethod
@WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908")
@RequestWrapper(localName = "getAvailabilityForecast", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908", className = "com.google.api.ads.admanager.jaxws.v201908.ForecastServiceInterfacegetAvailabilityForecast")
@ResponseWrapper(localName = "getAvailabilityForecastResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908", className = "com.google.api.ads.admanager.jaxws.v201908.ForecastServiceInterfacegetAvailabilityForecastResponse")
public AvailabilityForecast getAvailabilityForecast(
    @WebParam(name = "lineItem", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908")
    ProspectiveLineItem lineItem,
    @WebParam(name = "forecastOptions", targetNamespace = "https://www.google.com/apis/ads/publisher/v201908")
    AvailabilityForecastOptions forecastOptions)
    throws ApiException_Exception
;