dubbo服务接口如下
@Path("addcustomer")
public interface IncrCustomerInterface {
@POST
@Path("saveenter")
@Consumes
@Produces
public String saveEnterpriseInfo(@BeanParam EnterpriseInfo enterpriseInfo,@BeanParam CustomerBean custBean);
调用方代码如下
@RestController
@RequestMapping("/bankCustomer")
public class BankCustomerController {
@Autowired
private DubboSupport dubboSupport;
@RequestMapping("/testSingle")
public void testSingle() throws Exception {
EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
enterpriseInfo.setName(new String("测试企业名称".getBytes("ISO-8859-1"), "gbk"));
enterpriseInfo.setCustomerNo("000001111");
enterpriseInfo.setIdCardType(new String("二代身份证".getBytes("ISO-8859-1"), "UTF-8"));
enterpriseInfo.setAddress(new String("测试企业地址".getBytes("ISO-8859-1"), "gb2312"));
enterpriseInfo.setIdentityAddress("测试企业身份证地址");
enterpriseInfo.setIdentityNo("测试企业身份证号码110");
IncrCustomerInterface incrCustomerInterface = dubboSupport.getIncrCustomerInterface();
CustomerBean bean = new CustomerBean();
bean.setCustomerNo("11111");
incrCustomerInterface.saveEnterpriseInfo(enterpriseInfo,bean);
}
}
服务端接口接受到参数以后,里面的中文全部为乱码,怎么解决?