客户端使用WCF将数据上传到*服务器,如何验证数据是否已上传?

时间:2022-11-04 07:16:19

Less than 10 client computers, each with their own installation have to upload data to a central server.

少于10台客户端计算机,每台计算机都有自己的安装,必须将数据上传到*服务器。

The client database looks like:

客户端数据库如下所示:

tblSales - rowGuid - randomNumber

tblSales - rowGuid - randomNumber

Central Server database:

*服务器数据库

  • rowGuid
  • randomNumber
  • dateInserted

I plan to use WCF to send the files to the central server.

我计划使用WCF将文件发送到*服务器。

How can I verify the rows were inserted to the server? What kind of verification options do I have?

如何验证行已插入服务器?我有哪些验证选项?

I could return the # of rows inserted and compare that with the # that was sent, but is there any other more robust method?

我可以返回插入的行数并将其与发送的#进行比较,但还有其他更强大的方法吗?

2 个解决方案

#1


1  

You can also enable reliable messaging if using a binding like WsHttpBinding that will ensure the reliability of the messages themselves if that is a concern.

如果使用像WsHttpBinding这样的绑定,您还可以启用可靠的消息传递,如果这是一个问题,它将确保消息本身的可靠性。

#2


0  

Using WCF you're going to be basically calling a function thru a proxy. Just have that function return a bool true for success or false for failure.

使用WCF,您将基本上通过代理调用函数。只是让该函数返回bool true表示成功或false表示失败。

bool Success;
Success = MyWCFService.InsertRecord(MyNewRecord);

#1


1  

You can also enable reliable messaging if using a binding like WsHttpBinding that will ensure the reliability of the messages themselves if that is a concern.

如果使用像WsHttpBinding这样的绑定,您还可以启用可靠的消息传递,如果这是一个问题,它将确保消息本身的可靠性。

#2


0  

Using WCF you're going to be basically calling a function thru a proxy. Just have that function return a bool true for success or false for failure.

使用WCF,您将基本上通过代理调用函数。只是让该函数返回bool true表示成功或false表示失败。

bool Success;
Success = MyWCFService.InsertRecord(MyNewRecord);