从 .net core 2.0 调用 Web 服务,帮助我了解错误消息



我有一些正在调用Web服务的工作.net 4.x代码。 我必须将该代码移动到 .net core 2.0,我遇到了一些问题,我什至不理解错误消息。

LoginInfo li = new LoginInfo();
li.clientUserName = "username";
li.clientPassword = "password";
li.companyAccountNumber = "accountnumber";
li.companyIdentifierType = 1;
FKsoapPortTypeClient cl = new FKsoapPortTypeClient();
getAllVehiclesInputs inputs = new getAllVehiclesInputs();
inputs.clientUserName = li.clientUserName;
inputs.clientPassword = li.clientPassword;
inputs.companyAccountNumber = li.companyAccountNumber;
inputs.companyIdentifierType = li.companyIdentifierType;
getAllVehiclesResponse vd = await cl.getAllVehiclesAsync(inputs);

无法加载操作"getAllVehicles",因为它 在"文本"模式下指定 \"RPC 样式",但使用消息协定 类型或 System.ServiceModel.Channels.Message。这种组合是 不允许 -- 为样式或使用参数指定不同的值 消息协定类型或 系统.服务模型.通道.消息

有人可以指出我正确的方向吗? 如果您甚至不知道要查找的内容,则很难将其Google化。

尝试将以下软件包更新到版本 4.5.3,这似乎可以解决问题:

System.ServiceModel.Duplex

System.ServiceModel.Http

System.ServiceModel.NetTcp

系统.服务模型.安全

最新更新