constructor-igor / TechSugar

Tech. Sugar seminars
7 stars 7 forks source link

Implement WCF sample #435

Open constructor-igor opened 5 years ago

constructor-igor commented 5 years ago

Requirements:

Suggested architecture:

Code: https://github.com/constructor-igor/TechSugar/tree/master/WCF/Shavuot

Issues:

References:

constructor-igor commented 5 years ago

end-point definition reference: https://channel9.msdn.com/shows/Endpoint/Endpoint-Screencasts-Self-hosting-WCF-Services/ fast way for single computer communication: named pipe

  <system.serviceModel>
    <services>
      <service name="Shavuot.Service.ShavuotService">
        <endpoint address="net.pipe://shavuotservice" binding="netNamedPipeBinding"
          bindingConfiguration="" contract="Shavuot.Contract.IShavuotService" />
      </service>
    </services>
  </system.serviceModel>

To modify WCF configuration, it's possible to use image

constructor-igor commented 5 years ago

Problem with client "endpoint" definition: https://stackoverflow.com/questions/530342/cannot-load-the-x-509-certificate-identity-specified-in-the-configuration

<system.serviceModel>
    <client>
      <endpoint address="net.pipe://shavuotservice" binding="netNamedPipeBinding"
        bindingConfiguration="" contract="Shavuot.Contract.IShavuotService"
        name="ShavuotServiceEndpoint" kind="" endpointConfiguration="">
        <identity>
          <dns value="localhost" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>
constructor-igor commented 5 years ago

"subscribe" reference: https://www.codeproject.com/Articles/22796/WCF-Implementation-of-the-Publisher-Subscriber-Mod

constructor-igor commented 5 years ago

net.pipe endpoint definition:

server hosting:

  <system.serviceModel>
    <services>
      <service name="Shavuot.Service.ShavuotService">
        <endpoint address="net.pipe://shavuotservice" binding="netNamedPipeBinding"
          bindingConfiguration="" contract="Shavuot.Contract.IShavuotService" />
      </service>
    </services>
  </system.serviceModel>

client:

  <system.serviceModel>
    <client>
      <endpoint address="net.pipe://shavuotservice" binding="netNamedPipeBinding"
        bindingConfiguration="" contract="Shavuot.Contract.IShavuotService"
        name="ShavuotServiceEndpoint" kind="" endpointConfiguration="">
        <identity>
          <dns value="localhost" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>
constructor-igor commented 5 years ago

TCP/IP endpoint definition:

server hosting:

        <endpoint address="net.tcp://localhost:8888/shavuotservice" binding="netTcpBinding"
          bindingConfiguration="" name="TCPIP" contract="Shavuot.Contract.IShavuotService" />

client:

      <endpoint address="net.tcp://localhost:8888/shavuotservice" binding="netTcpBinding"
                bindingConfiguration="" name="TCPIP" contract="Shavuot.Contract.IShavuotService" />