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 来测试我的网络服务
- WS URL :
http://localhost:4080/ws/Tab/window/143/tab/186?=null&%20REQUEST%20HEADER%20=null&X-SessionId=1159871
- 方法:GET
问题:
- 参数window_ID = 143 --> 确定
- 参数tab_ID =
NULL
--> KO
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);
}
@PathVariable
从 String tab
参数中丢失。
我正在使用 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 来测试我的网络服务
- WS URL : http://localhost:4080/ws/Tab/window/143/tab/186?=null&%20REQUEST%20HEADER%20=null&X-SessionId=1159871
- 方法:GET
问题:
- 参数window_ID = 143 --> 确定
- 参数tab_ID =
NULL
--> KO
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);
}
@PathVariable
从 String tab
参数中丢失。