简体   繁体   中英

Scheduled file transfer via WCF

For the scheduled part I will use Quartz.net but for the file transferring part I am completely lost.

I found many examples but not close to what I need. I want to use two WCF libraries (no graphical interface) hosted in IIS to transfer files, no more than one GB. I understand the code (most of it) but when it comes to the ABC (address, bindings, contracts) it gets complicated. Can anyone point me to the right direction?

WCF is a powerful framework and flexible in terms of IPC. And that flexibility has accompanied of complexity as well ( may be for me when I was learning this stuff ).

  1. Address - Where is the service? It pertains to the location of your service just like URL.

Ex. http://localhost/YourServicePath/Service.svc

  1. Binding - How do I talk to the service? This is quiet complicated because it involve protocols and security. Binding defines on how both client and server will communicate to each other. There are different types of bindings. Bindings can be done through configuration file and/or programmatically.

Ex. BasicHttpBinding, WSHttpBinding ,WSDualHttpBinding , NetTcpBinding, WSFederationHttpBinding, NetNamedPipeBinding, NetMsmqBinding,NetPeerTcpBinding

<bindings>
      <wsHttpBinding>
        <binding name="wshttpbind"  allowCookies="true" closeTimeout="00:01:00" 
        receiveTimeout="00:01:00" />
      </wsHttpBinding>
  </bindings>
  1. Contracts - What can the service do for me? Contracts are all information exposed to both party that agrees to used for exchanging of message. It could be Data, Operation/Service/Methods or Message contract.

Ex. Service Contract, DataContract, Message Contract and Fault Contract.

[ServiceContract]
public interface ICalculate
{
   [OperationContract]
   double Add( double a, double b);
   [OperationContract]
   double Subtract( double a, double b);
}

I suggest to you to read article about it first for you not to lost along your development.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM