Java Code Examples for javax.jws.WebMethod#action()

The following examples show how to use javax.jws.WebMethod#action() . 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: JavaMethodImpl.java    From TencentKona-8 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 2
Source File: JavaMethodImpl.java    From jdk8u60 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 3
Source File: JavaMethodImpl.java    From openjdk-jdk8u 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 4
Source File: JavaMethodImpl.java    From openjdk-jdk8u-backup 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: JavaMethodImpl.java    From openjdk-jdk9 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 6
Source File: JavaMethodImpl.java    From hottub 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 7
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 8
Source File: JavaMethodImpl.java    From openjdk-8 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 9
Source File: JaxWsServiceConfiguration.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Override
public String getAction(OperationInfo op, Method method) {
    method = getDeclaredMethod(method);
    WebMethod wm = method.getAnnotation(WebMethod.class);
    String action = "";
    if (wm != null) {
        action = wm.action();
    }
    if (StringUtils.isEmpty(action)) {
        Action act = method.getAnnotation(Action.class);
        if (act != null) {
            action = act.input();
        }
    }
    return action;
}
 
Example 10
Source File: SMethod.java    From BIMserver with GNU Affero General Public License v3.0 5 votes vote down vote up
@SuppressWarnings("rawtypes")
public SMethod(SService service, Method method) {
	this.service = service;
	this.method = method;
	
	WebMethod webMethod = method.getAnnotation(WebMethod.class);
	if (webMethod == null) {
		this.name = method.getName();
		LOGGER.warn("Method " + method.getName() + " has no @WebMethod annotation");
	} else {
		this.name = webMethod.action();
	}
	
	int parameterCounter = 0;
	for (Class<?> parameterType : method.getParameterTypes()) {
		String paramName = "arg" + parameterCounter;
		WebParam webParam = extractAnnotation(parameterCounter, WebParam.class);
		if (webParam != null) {
			paramName = webParam.name();
		} else {
			LOGGER.warn("Method " + method.getName() + " parameter " + parameterCounter + " has no @WebParam annotation");
		}
		Class<?> genericType = getGenericReturnType(parameterCounter);
		parameters.add(new SParameter(this, service.getServicesMap().getSType(parameterType.getName()), genericType == null ? null : service.getServicesMap().getSType(genericType.getName()), paramName));
		parameterCounter++;			
	}
	this.returnType = service.getServicesMap().getSType(method.getReturnType().getName());
	if (method.getReturnType() == List.class || method.getReturnType() == Set.class) {
		Type genericReturnType = method.getGenericReturnType();
		ParameterizedType parameterizedType = (ParameterizedType)genericReturnType;
		Type type = parameterizedType.getActualTypeArguments()[0];
		if (type instanceof Class) {
			this.genericReturnType = service.getServicesMap().getSType(((Class)type).getName());
		}
	}
	}