客户eas版本为60升级上来的的EAS701,费用报销在OA中实现,需推送eas凭证,通过wsdl开发客户端之后,调用凭证导入接口一直返回null
ws客户端测试代码如下:
public class VoucherTest2 {
public static void main(String[] args) {
try {
String sessionID = login();
WSGLWebServiceFacadeSoapBindingStub stub = new WSGLWebServiceFacadeSoapBindingStub(new URL("h t t p://10. 18. 4. 160: 6890/ormrpc/services/WSGLWebServiceFacade"),null);
WSWSVoucher[] col = new WSWSVoucher[1];
WSWSVoucher voucher0 = new WSWSVoucher();
col[0] = voucher0;
voucher0.setCompanyNumber("11"); //公司编码
voucher0.setBookedDate("2015-11-30");//记账日期
voucher0.setBizDate("2015-11-30"); //业务日期
voucher0.setPeriodYear(2015); //会计年度
voucher0.setPeriodNumber(11); //会计期间
voucher0.setVoucherType("记"); //凭证类型
voucher0.setAttaches(0); //附件数
voucher0.setVoucherNumber("123234");//凭证号
voucher0.setEntrySeq(1); //分录
voucher0.setAccountNumber("1001"); //科目编码
voucher0.setCurrencyNumber("0"); //本币编码
voucher0.setEntryDC(1); //方向
voucher0.setOriginalAmount(100); //原币金额
voucher0.setDebitAmount(100); //借方金额
voucher0.setCreator("预设用户"); //制单人
voucher0.setVoucherAbstract("借方摘要");//摘要
voucher0.setLocalRate(1); //汇率
stub.setHeader("h t t p://10. 18. 4. 160: 6890/ormrpc/services/WSGLWebServiceFacade","SessionId",sessionID);
String[] returns = stub.importVoucher(col , 0, 0, 0);
System.out.println(Arrays.toString(returns));
} catch (Exception e) {
e.printStackTrace();
}
}
private static String login() throws RemoteException, MalformedURLException {
EASLoginProxyServiceLocator service = new EASLoginProxyServiceLocator();
EASLoginSoapBindingStub stub = new EASLoginSoapBindingStub(new URL("h t tp://10 .18 . 4 . 160: 6890/ormrpc/services/EASLogin"), service);
WSContext context = stub.login("002294", "abc123", "eas", "eas20151008", "L2", 2);
String sessionid=context.getSessionId();
if(sessionid == null)
{
System.out.print("EAS接口登录方法login,失败!");
}else{
System.out.println("sessionid:"+sessionid);
}
return sessionid;
}
}
执行结果如下:
服务端日志如下:
2015-12-01 10:20:23 INFO [con.out] Eas Multi Auth result:true2015-12-01 10:20:23 INFO [con.out] [2015-12-01 10:20:23,638 INFO RPC-5]orgTypeStr is null2015-12-01 10:20:23 INFO [con.out] [2015-12-01 10:20:23,638 INFO RPC-5] orgTypeStr is null!2015-12-01 10:20:23 INFO [con.out] [2015-12-01 10:20:23,638 INFO RPC-5]add Session. sessionID is fcbd416b-3516-45af-9675-4746797fd5be2015-12-01 10:20:23 INFO [con.out] [2015-12-01 10:20:23,638 INFO RPC-5]UIHandlerPermissionHelper add listener to session fcbd416b-3516-45af-9675-4746797fd5be2015-12-01 10:20:23 ERROR [con.err] com.kingdee.eas.base.usermonitor.UserMonitorException: 用户IP地址为空!2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.eas.base.usermonitor.app.UserMonitorRegistryManager.checkAddnew(UserMonitorRegistryManager.java:134)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.eas.base.usermonitor.app.UserMonitorRegistryManager.addnew(UserMonitorRegistryManager.java:158)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.eas.base.usermonitor.UserMonitorAgent.addnew(UserMonitorAgent.java:45)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.eas.base.usermonitor.UserMonitor.addnew(UserMonitor.java:48)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.eas.base.uiframe.app.LoginContextFilterImpl.saveUMRegistryInfo(LoginContextFilterImpl.java:255)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.eas.base.uiframe.app.LoginContextFilterImpl.doFilter(LoginContextFilterImpl.java:136)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.bos.framework.session.LoginContextInterceptor.doFilters(LoginContextInterceptor.java:33)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.bos.framework.session.LoginModule.fullLogin(LoginModule.java:185)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.bos.framework.session.LoginModule.login(LoginModule.java:83)2015-12-01 10:20:23 ERROR [con.err] at rpc_generate._PROXY_com_1_kingdee_1_bos_1_framework_1_session_1_ILoginModule.pi8(Unknown Source)2015-12-01 10:20:23 ERROR [con.err] at rpc_generate._PROXY_com_1_kingdee_1_bos_1_framework_1_session_1_ILoginModule.processInvoke(Unknown Source)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.bos.rpc.impl.ObjectProxy.processInvoke(ObjectProxy.java:177)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.bos.rpc.impl.RPCService.serviceInvoke(RPCService.java:629)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.bos.rpc.impl.RPCService.service(RPCService.java:125)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.bos.rpc.impl.ServiceDispatcher.run(ServiceDispatcher.java:153)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.bos.rpc.impl.ThreadJob.run(ThreadJob.java:24)2015-12-01 10:20:23 ERROR [con.err] at com.kingdee.bos.rpc.impl.ThreadPool2$Worker.run(ThreadPool2.java:103)2015-12-01 10:20:23 INFO [con.out] [2015-12-01 10:20:23,654 INFO RPC-5]---After authenticated, save UMRegistryInfo spent:16 ms.2015-12-01 10:20:23 INFO [con.out] [2015-12-01 10:20:23,654 INFO RPC-5]-After authenticated, LoginContextFilter spent:16 ms.
哪位有这方面的开发经验,请帮我分析一下,谢谢!
推荐阅读