Answered by:
Proxy for SyncServices over WCF Scenario

Question
-
Hello,
I am running a Sync-Application via WCF. It works fine with HTTP and HTTPS.
Now I have a new customer which only allows HTTP via a HTTP-Proxy (Port 8080).
The customer installed my application, but is not able to Sync to the server (via Internet, not Intranet!).
Before I am going to visit the customer, I want to research about possible problems.
The only difference I found it is, that the customers uses this Proxy.
Does anybody of you have an idea if and why a proxy could be a problem for the sync-services scenario?
Regards,
Martin- Moved by Hengzhe Li Friday, April 22, 2011 2:27 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
Tuesday, July 21, 2009 9:18 AM
Answers
-
Hello -
In general, Sync Service or Sync Framework does not do any specific thing to HTTP-PROXY. If it works for HTTP or HTTPS, it should also works for HTTP-PROXY.
One suggestion - please try to connect to the WCF service through Http-Proxy protocol using an IE browser and see what error message it comes out. Try to fix issue from that route.
Thanks.
Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.- Proposed as answer by L Zhou [MSFT]Editor Wednesday, July 22, 2009 10:56 PM
- Marked as answer by macap Thursday, July 23, 2009 9:02 AM
Wednesday, July 22, 2009 10:56 PMAnswerer
All replies
-
It is nothing about Sync Services. You need to configure the System.Net, ex.
<configuration>
<
system.net>
<
defaultProxy
useDefaultCredentials="true" >
</
defaultProxy>
</
system.net>
Please see following post for more details:
http://social.msdn.microsoft.com/forums/en-US/wcf/thread/5f8d2c3a-164f-411a-b387-91f0be51f190Tuesday, July 21, 2009 11:51 PM -
Hi Bob,
thank you very much. It´s a good way to start, although it does not help 100%,
because I am using the Compact Framework which does not have App.Config files and deals a bit different with the System.Net.
If I find a solution for CF, I will post it here.
If anybody knows an answer... feel free to help ;-)
Regards,
MartinWednesday, July 22, 2009 9:14 AM -
Hello -
In general, Sync Service or Sync Framework does not do any specific thing to HTTP-PROXY. If it works for HTTP or HTTPS, it should also works for HTTP-PROXY.
One suggestion - please try to connect to the WCF service through Http-Proxy protocol using an IE browser and see what error message it comes out. Try to fix issue from that route.
Thanks.
Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.- Proposed as answer by L Zhou [MSFT]Editor Wednesday, July 22, 2009 10:56 PM
- Marked as answer by macap Thursday, July 23, 2009 9:02 AM
Wednesday, July 22, 2009 10:56 PMAnswerer -
In general, Sync Service or Sync Framework does not do any specific thing to HTTP-PROXY. If it works for HTTP or HTTPS, it should also works for HTTP-PROXY.
Yes you are right! I just tried it with a Proxy (TCPCatcher) and a connection via Bluetooth/ActiveSync to the Mobile device.
One suggestion - please try to connect to the WCF service through Http-Proxy protocol using an IE browser and see what error message it comes out. Try to fix issue from that route.
The Sync-Process works fine when I add TCPCatcher as proxy to the mobile device.
Thursday, July 23, 2009 9:05 AM -
Martin,
Without app.config, you can set the properties of your bindings in your code. ex.
BasicHttpBinding syncBasicHttpBinding = new BasicHttpBinding();
syncBasicHttpBinding.UseDefaultWebProxy = true;
syncBasicHttpBinding.BypassProxyOnLocal = true;syncEndpointAddress = new EndpointAddress("http://syncserver/SyncService.svc");
SyncServiceClient client = new SyncServiceClient(syncBasicHttpBinding, syncEndpointAddress);
...WSHttpBinding has same properties. Basically, it is about configure proxy for WCF.
Thursday, July 23, 2009 12:17 PM -
Hi Bob,
is your code snippet from CTP 2?
I do not have e.g. a class "SyncServiceClient" in the MS SyncFramework API.
Regrds,
MartinFriday, July 24, 2009 7:49 AM -
SyncServiceClient is a proxy class generated from the WCF service for synchronisation. It can be any other name.Friday, July 24, 2009 12:35 PM