Search code examples
wcfwcf-binding

Testing WCF services in Oracle VirtualBox


I'm using a self-hosted WCF service that used TCP binding. I want to test it on my VirtualBox's virtual machine. I use NAT for network driver. Should I use port forwarding? And how should I change my client app's .config file? This is one I use for testing on localhost:

<client>
     <endpoint address="net.tcp://localhost:8090/Service/" 
               binding="netTcpBinding"
               bindingConfiguration="NetTcpBinding_IMyWCFService"
               contract="MyWCFService.IMyWCFService"
               name="NetTcpBinding_IMyWCFService">
     </endpoint>
</client>

Solution

  • NAT is fine, and should work accordingly if all you want to do is to develop and test locally, but if you want to handle external requests with your virtual machine, for that, NAT is too basic and won't make te cut for a SERVER role.

    So is better to configure your VM with Bridge Networking: https://blogs.oracle.com/fatbloke/entry/networking_in_virtualbox1#Bridged

    In that case, you will have your own IP in your virtual server which you can configure in the app.config and you will be able to point from the "outside world"