在编写 JAXWS 客户端时,这是我过去使用的:
// CALL SERVICE
EPaymentsService bPayService = new EPaymentsService();
ServiceInterface stub = bPayService.getPort();
BindingProvider bp = (BindingProvider) stub;
Map<String, Object> rc = bp.getRequestContext();
String endPointUrl = propFile.getString(Constants.END_POINT_URL);
rc.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endPointUrl);
// RESPONSE
ResponseMessage resMessage = stub.sendMessage(reqMessage);
在我的代码中,ServiceInterface 没有扩展 BindingProvider。那么为什么我们在转换时没有收到错误
BindingProvider bp = (BindingProvider) stub;