URL of webservice 获取 return 空参数

URL of webservice Get return Null Parameter

我正在使用 spring MVC 构建一个简单的 WebService

这是我的类

1 - 界面

import org.compiere.framework.VO;

    import com.audaxis.compiere.api.CompiereAPIApplicationException;
    import com.audaxis.erp.service.IBaseService;

    public interface IADTabService extends IBaseService  {

        public VO read(String window_ID, String tab_ID) throws CompiereAPIApplicationException;

    }

2 - 控制器

@Controller
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Api(tags="AD")
public class ADTabWs extends BaseWs<IADTabService> {

    @RequestMapping(value="/Tab/window/{window}/tab/{tab}", method = RequestMethod.GET)
    public @ResponseBody VO read(@PathVariable String window, String tab, @RequestHeader(value="X-SessionId", required=false) String session_id) 
            throws CompiereAPIApplicationException  {
        //@RequestHeader("X-SessionId") 
        return service.read(window, tab);
    }

}

现在,我正在使用 Jason 来测试我的网络服务

问题:

AND 这是日志:

2018-04-04 15:38:28.897 INFO  c.a.compiere.service.ad.ADTabService - 143 - null 

找不到问题!!!

请按如下方式编辑您的函数:-

@RequestMapping(value="/Tab/window/{window}/tab/{tab}", method = RequestMethod.GET)
public @ResponseBody VO read(@PathVariable String window, @PathVariable String tab, @RequestHeader(value="X-SessionId", required=false) String session_id) 
        throws CompiereAPIApplicationException  {
    //@RequestHeader("X-SessionId") 
    return service.read(window, tab);
}

@PathVariableString tab 参数中丢失。