locked
Based on WebSharingAppDemo, what is necessary for syncing to work over WCF hosted on IIS? RRS feed

  • Question

  •  

    SFx 2.1; Sql Server 2008; WCF; SqlCe

     

    We followed the example WebSharingAppDemo-SqlProviderEndToEnd to create an n-tier application.  All works as expected when accessing the service over the LAN.  When trying to access the service from outside our LAN we get the following error:

     

    Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

     

    We can access the service from outside the LAN.

     

    When stepping through the code, the failure occurs when the service-side code tries to access SQL Server.

     

    The demo has all client and server side code in one .dll … the .dll is referenced by both the service and the client application.

     

    Unlike the demo … we installed the service on IIS.

     

    Question: Based on the demo, what is necessary for syncing to work over WCF hosted on IIS?

     

     

    Thursday, June 23, 2011 11:21 PM

Answers

  • have you modified that demo app. if am not mistaken that demo app actually connects to the server database directly.

    so if your firewall/network settings dont have the ports open to allow database connections from the outside your LAN, that would explain the error you're getting.

    • Marked as answer by P H T Friday, June 24, 2011 7:18 PM
    Friday, June 24, 2011 1:23 AM
  • Thanks JuneT ... again!

    I agree that would explain it ... the WebSharingAppDemo is an n-tier example whereas SharingAppDemo is a 2-tier example.  I would expect the 2-tier demo to connect to SQL directly ... but I thought the n-tier would not ... and looking at the code ... I don't see that it does.

    WebSharingAppDemo actually creates a proxy in code (which I am less familiar with) instead of using a VS generated ServiceReference.

    • Marked as answer by P H T Friday, June 24, 2011 7:18 PM
    Friday, June 24, 2011 2:06 PM

All replies

  • have you modified that demo app. if am not mistaken that demo app actually connects to the server database directly.

    so if your firewall/network settings dont have the ports open to allow database connections from the outside your LAN, that would explain the error you're getting.

    • Marked as answer by P H T Friday, June 24, 2011 7:18 PM
    Friday, June 24, 2011 1:23 AM
  • Thanks JuneT ... again!

    I agree that would explain it ... the WebSharingAppDemo is an n-tier example whereas SharingAppDemo is a 2-tier example.  I would expect the 2-tier demo to connect to SQL directly ... but I thought the n-tier would not ... and looking at the code ... I don't see that it does.

    WebSharingAppDemo actually creates a proxy in code (which I am less familiar with) instead of using a VS generated ServiceReference.

    • Marked as answer by P H T Friday, June 24, 2011 7:18 PM
    Friday, June 24, 2011 2:06 PM
  • is the Service and Sql Server on the same machine? how are you authenticating to Sql Server?

    are you getting the error on this call?

    public SqlSyncProvider ConfigureSqlSyncProvider(string hostName)


    Friday, June 24, 2011 2:35 PM
  • Thanks JuneT ... bug in our code ...

    Figured out that we coded a second service to handle ancilary calls ... and we were getting the 2 services mixed up in code ... we consolidated the services and life is good!

    We could have gotten the 2 to work ... no need to really have 2.

    Friday, June 24, 2011 7:18 PM