简体   繁体   中英

WCF wsdualhttpbinding binding on Windows Azure VM

We have a WCF application with multiple bindings running on Windows Services, the application is working as expected on an intranet environment however when we deployed our solution to windows azure VM, it seems all our services are running fine except those that uses wsdualhttpbinding binding !!!

Our services are running on port 8099 therefore we created an endpoint on VM with public and private ports set to 8099, we also disabled the firewall for the time being. we even try to use Azure network to establish a point to site VPN but none of them worked.

we set the base address as http://XXX.cloudapp.net:8099/MYSvc but again same issue... This solution is working fine if I run the client application on the same machine that hosts the services on azure however if I try to use another machine it fails. I even tried to create another VM on the same subnet and run the client app from within azure network to replicate an Intranet environment, again no success...

There is no error to copy here, it seems when the client app reaches a duplex service, it keeps waiting for a response and does not allow user to do anything!

Is it because of traffic routing or .... any suggestion? are we missing something? We prefer to use wsdualhttpbinding unless there is no solution...

Since nobody answered the question and due to the fact I found a solution, I like to share it here in case somebody need it.

On azure wsdualhttpbinding cannot find the client address just because of routing issues, so even if you use VPN the issue persists.

The solution is to use ClientBaseAddress as for your wsdualhttpbinding binding like so:

WSDualHttpBinding dualBinding = new WSDualHttpBinding();
EndpointAddress endptadr = new EndpointAddress("http://XXX:12000/DuplexTestUsingCode/Server");
dualBinding.ClientBaseAddress = new Uri("http://XXX:8000/DuplexTestUsingCode/Client/");

refer to this link http://msdn.microsoft.com/en-us/library/system.servicemodel.wsdualhttpbinding.clientbaseaddress(v=vs.110).aspx

and aslo here: http://social.msdn.microsoft.com/Forums/vstudio/en-US/e5fca7a5-9a90-48de-a81c-ec2e18b7ae6a/wsdualhttpbinding-and-clients-on-remote-machines

You have to bear in mind that the load balancer closes any idle connections after one minute. You can't turn off this behavior on Azure, so if your process takes more than a minutes, the callback channel will be closed by load balancer and you get timeout exception.

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