AIXS 调用CFX 对象数组 参数

AIXS 调用CFX 对象数组  参数

关键一句话是call.setEncodingStyle(null);

 

Call call = (Call) service.createCall();
            call.addParameter("agentInfos", XMLType.XSD_ANY, ParameterMode.IN);
            call.setEncodingStyle(null);
            call.setOperationName(new QName("http://eip.hola.com.cn", "addAgents"));
            call.setTargetEndpointAddress(new java.net.URL("http://localhost/ehrSync/ws/agentservice?wsdl"));
            QName qName = new QName("http://eip.hola.com.cn", "AgentInfo");
            call.registerTypeMapping(AgentInfo.class, qName, new BeanSerializerFactory(AgentInfo.class, qName), new BeanDeserializerFactory(AgentInfo.class, qName),false);
            AgentInfo agentInfo = new AgentInfo();
            agentInfo.setID("S1788");
            agentInfo.setAgentUserID("S1608");
            agentInfo.setStartTime(DateUtil.parse3("2011-07-11 09:00:00"));
            agentInfo.setEndTime(DateUtil.parse3("2011-07-12 18:00:00"));

            AgentInfo agentInfo2 = new AgentInfo();
            agentInfo2.setID("s1713");
            agentInfo2.setAgentUserID("S1608");
            agentInfo2.setStartTime(DateUtil.parse3("2011-07-10 09:00:00"));
            agentInfo2.setEndTime(DateUtil.parse3("2011-07-12 18:00:00"));
            
            AgentInfo[] agentInfos = new AgentInfo[2];
            agentInfos[0] = agentInfo;
            agentInfos[1] = agentInfo2;
            Object str = call.invoke(new Object[] { agentInfos });
            String[] result=(String[])JavaUtils.convert(str, String[].class);
            System.out.println(result[0]);
            System.out.println(result[1]);
 

你可能感兴趣的:(AIX)