类javax.jws.WebMethod源码实例Demo

下面列出了怎么用javax.jws.WebMethod的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: openmeetings   文件: RoomWebService.java
/**
 * 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);
	});
}
 
源代码2 项目: openjdk-8-source   文件: JavaMethodImpl.java
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());
        }
    }
}
 
源代码3 项目: sakai   文件: Activity.java
/**
 * 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);
}
 
源代码4 项目: sakai   文件: SakaiConfiguration.java
/**
 * @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);

}
 
@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;
}
 
源代码6 项目: rice   文件: DocumentTypeService.java
@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;
 
源代码7 项目: rice   文件: KewTypeRepositoryService.java
/**
 * 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;
 
源代码8 项目: onvif   文件: DeviceIOPort.java
/**
 * 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
);
 
@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;
}
 
源代码10 项目: freehealth-connector   文件: TIPPortType.java
@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;
 
源代码11 项目: onvif   文件: Media.java
/**
 * 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
);
 
源代码12 项目: sakai   文件: SakaiReport.java
@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));
}
 
@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;
}
 
源代码14 项目: onvif   文件: DisplayPort.java
/**
     * 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()
;
 
源代码15 项目: freehealth-connector   文件: ExecutorServices.java
@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;
 
源代码16 项目: onvif   文件: Device.java
/**
     * 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()
;
 
@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;
}
 
源代码18 项目: freehealth-connector   文件: PCDHPortType.java
@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;
 
@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;
}
 
源代码20 项目: onvif   文件: ReplayPort.java
/**
     * 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()
;
 
源代码21 项目: kfs   文件: AwardAccountService.java
@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
);
 
@WebMethod
@WebResult(name = "result")
public double calculatePower(@WebParam(name = "base") double base,
                             @WebParam(name = "exponent") double exponent) {
    return Math.pow(base, exponent);
}
 
源代码23 项目: jolie   文件: WSTest.java
@WebMethod( operationName = "sum", action = "tns:sum" )
public Integer sum( @WebParam( name = "x" ) Integer x, @WebParam( name = "y" ) Integer y ) {
	return Calculator.sum( x, y );
}
 
源代码24 项目: dropwizard-jaxws   文件: SimpleService.java
@WebMethod
@Metered
public String echo(String input) {
    return input;
}
 
源代码25 项目: fosstrak-epcis   文件: EPCISServicePortType.java
@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;
 
源代码26 项目: openjdk-jdk8u-backup   文件: WSTest.java
@WebMethod
public String getMethod1Value() {
    return "from Method1";
}
 
源代码27 项目: glowroot   文件: CxfClientPluginIT.java
@WebMethod
String hello(@WebParam(name = "text") String text);
 
源代码28 项目: BIMserver   文件: ServiceInterface.java
@WebMethod(action = "determineIfcVersion")
String determineIfcVersion(
	@WebParam(name = "head", partName = "determineIfcVersion.head") byte[] head, 
	@WebParam(name = "zipped", partName = "determineIfcVersion.zipped") Boolean zipped) throws UserException, ServiceException;
 
/**
 * 
 *         Performs actions on {@link ForecastAdjustment} objects that match the given {@link
 *         Statement#query}.
 *         
 *         <p>This method requires that use of traffic forecast segments and forecast adjustments is
 *         enabled for this network, and will throw an exception if it is not enabled.
 *         
 *         @param forecastAdjustmentAction the action to perform
 *         @param filterStatement a Publisher Query Language statement used to filter a set of forecast
 *         adjustments
 *         @return the result of the action performed
 *       
 * 
 * @param forecastAdjustmentAction
 * @param filterStatement
 * @return
 *     returns com.google.api.ads.admanager.jaxws.v202005.UpdateResult
 * @throws ApiException_Exception
 */
@WebMethod
@WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v202005")
@RequestWrapper(localName = "performForecastAdjustmentAction", targetNamespace = "https://www.google.com/apis/ads/publisher/v202005", className = "com.google.api.ads.admanager.jaxws.v202005.AdjustmentServiceInterfaceperformForecastAdjustmentAction")
@ResponseWrapper(localName = "performForecastAdjustmentActionResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v202005", className = "com.google.api.ads.admanager.jaxws.v202005.AdjustmentServiceInterfaceperformForecastAdjustmentActionResponse")
public UpdateResult performForecastAdjustmentAction(
    @WebParam(name = "forecastAdjustmentAction", targetNamespace = "https://www.google.com/apis/ads/publisher/v202005")
    ForecastAdjustmentAction forecastAdjustmentAction,
    @WebParam(name = "filterStatement", targetNamespace = "https://www.google.com/apis/ads/publisher/v202005")
    Statement filterStatement)
    throws ApiException_Exception
;
 
源代码30 项目: development   文件: OrganizationalUnitService.java
/**
 * Deletes the given organizational unit in the organization of the calling
 * user.
 * <p>
 * Required role: administrator of the organization to which the
 * organizational unit belongs
 * 
 * @param organizationalUnitName
 *            the name of the unit to be deleted
 * @throws ObjectNotFoundException
 *             if the unit is not found in the calling user's organization
 * @throws OperationNotPermittedException
 *             if the unit does not belong to the calling user's
 *             organization or if subscriptions are assigned to it
 * @throws DeletionConstraintException
 * @throws MailOperationException
 */
@WebMethod
void deleteUnit(
        @WebParam(name = "organizationalUnitName") String organizationalUnitName)
                throws ObjectNotFoundException,
                OperationNotPermittedException, DeletionConstraintException,
                MailOperationException;