B1WS UsersService GetByParams抛出System.InvalidOperationException

2020-08-24 04:30发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)大家好, ...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


大家好,

我正在使用B1WS UsersService读取用户详细信息,如下所示。

 UsersService l_user = new UsersService();

//MsgHeader类
 MsgHeader msgHeader =新的MsgHeader();
 msgHeader.SessionID = SuperUserSession;
 msgHeader.ServiceName = MsgHeaderServiceName.UsersService;
 msgHeader.ServiceNameSpecified = true;
 l_user.MsgHeaderValue = msgHeader;

 UserParams参数= new UserParams(){InternalKey = 4,InternalKeySpecified = true};
 用户SAPUser = l_user.GetByParams(param); //这里EXCEPTION 

上面的代码是否有问题? 看起来XML反序列化有问题。

查看例外详细信息

System.InvalidOperationException:XML文档中存在错误(1,665) 。 ---> System.FormatException: 字符串未被识别为有效的DateTime 。 在System.DateTimeParse.ParseExactMultiple(String s,String []格式,DateTimeFormatInfo dtfi,DateTimeStyles样式)在Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderUsersService.Read11_User(Boolean isNullable,Boolean checkType)在Microsoft.Xml.Serializationer.GeneratedAs Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer19.Deserialize(XmlSerializationReader reader)上的.Read25_GetByParamsResponse()在System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,String encodingStyle,XmlDeserialization)的String。 -在System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage消息,WebResponse响应,流responseStream,系统布尔值asyncCall)的System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,字符串encodingStyle,XmlDeserializationEvents事件)处。 Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String methodName,Object []参数),位于UsersService.GetByParams(UserParams UserParams)

我检查了DI SERVER日志,发现响应如下。 这是不是因为没有从DI服务器返回所有信息而导致错误?

<?xml版本=" 1.0"编码=" UTF-8"?> 4 Support Support tYES <部门> 1 <锁定> tNO ug_Regular 100.000000 100.000000 100.000000 tNO 0.000000 2018-04-13 1143:41:00 > 1020:17:00 管理器 1 Support actionLogoff 支持 111.111.111.111 company-PC4 2018-04- 13 1446:38:00 -1 B1_DIServer.exe 4240 Support actionLogin Support 111.111.111.111 company-PC4 < ActionDate> 2018-04-13 1143:41:00 -1 B1_DIServer.exe 4240 Support actionLogin Support 111.111.111.111 company- PC4 2018-04-12 906:35:00 -1 B1_DIServer.exe 3772 Support actionLogin Support 111.111.111.111 company-PC4 < ActionDate> 2018-04-11 1424:30:00 -1 B1_DIServer.exe 4076 Support actionLogoff Support 111.111.111.111 company- PC4 2018-04-10 1134:13:00 -1 B1_DIServer.exe 1692 Support actionLogin Support 111.111.111.111 company-PC4 2018-04-10 1119:03:00 -1 B1_DIServer.exe 1692 Support actionLogin Support 111.111.111.111 company- PC4 2018-04-10 1118:52:00 -1 B1_DIServer.exe 1692 Support actionLogoff Support 111.111.111.111 company-PC4 2018-04-09 1733:07:00 -1 B1_DIServer.exe 4056 支持 actionLogin 支持 111.111.111.111 company-PC4 < ActionDate> 2018-04-05 2305:33:00 -1 B1_DIServer.exe 4056 Support actionLogoff Support 111.111.111.111 company- PC4 2018-04-05 1758:00:00 -1 B1_DIServer.exe 4056