locked
EndPoint question !!! RRS feed

  • Question

  • hello i need to synchrnonize between SQL SERVER 2008 and SQL Server CE 3.5

    i made a WCF service but the problem i am getting an error when i want to access this service by using localhost:port
    here is the error i am getting :

    L'exception System.Reflection.TargetInvocationException n'a pas été gérée
      Message="TargetInvocationException"
      StackTrace:
           at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)
           at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
           at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
           at Microsoft.Synchronization.Data.ServerSyncProviderProxy.ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
           at Microsoft.Synchronization.SyncAgent.UploadChanges(SyncGroupMetadata groupMetadata)
           at Microsoft.Synchronization.SyncAgent.Synchronize()
           at Corim_Mobile_101.Form1.Synchronize()
      InnerException: System.ServiceModel.EndpointNotFoundException
           Message="There was no endpoint listening at http://localhost:8731/Design_Time_Addresses/ServiceWCF/ToServerSyncService/ that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."
           StackTrace:
                at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
                at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
                at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
                at System.ServiceModel.Channels.RequestChannel.Request(Message message)
                at Microsoft.Tools.ServiceModel.CFClientBase`1.getReply(Message msg)
                at Microsoft.Tools.ServiceModel.CFClientBase`1.Invoke[TREQUEST,TRESPONSE](CFInvokeInfo info, ApplyChangesRequest request)
                at ToServerSyncContractClient.ApplyChanges(ApplyChangesRequest request)
                at ToServerSyncContractClient.ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
                at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
                at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)
                at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
                at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
                at Microsoft.Synchronization.Data.ServerSyncProviderProxy.ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
                at Microsoft.Synchronization.SyncAgent.UploadChanges(SyncGroupMetadata groupMetadata)
                at Microsoft.Synchronization.SyncAgent.Synchronize()
                at Corim_Mobile_101.Form1.Synchronize()
           InnerException: System.Net.WebException
                Message="Unable to connect to the remote server"
                StackTrace:
                     at System.Net.HttpWebRequest.finishGetResponse()
                     at System.Net.HttpWebRequest.GetResponse()
                     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
                     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
                     at System.ServiceModel.Channels.RequestChannel.Request(Message message)
                     at Microsoft.Tools.ServiceModel.CFClientBase`1.getReply(Message msg)
                     at Microsoft.Tools.ServiceModel.CFClientBase`1.Invoke[TREQUEST,TRESPONSE](CFInvokeInfo info, ApplyChangesRequest request)
                     at ToServerSyncContractClient.ApplyChanges(ApplyChangesRequest request)
                     at ToServerSyncContractClient.ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
                     at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
                     at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)
                     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
                     at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
                     at Microsoft.Synchronization.Data.ServerSyncProviderProxy.ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession)
                     at Microsoft.Synchronization.SyncAgent.UploadChanges(SyncGroupMetadata groupMetadata)
                     at Microsoft.Synchronization.SyncAgent.Synchronize()
                     at Corim_Mobile_101.Form1.Synchronize()
                InnerException: System.Net.Sockets.SocketException
                     Message="No connection could be made because the target machine actively refused it"
                     ErrorCode=10061
                     NativeErrorCode=10061
                     StackTrace:
                          at System.Net.Sockets.Socket.ConnectNoCheck(EndPoint remoteEP)
                          at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
                          at System.Net.Connection.doConnect(IPEndPoint ep)
                          at System.Net.Connection.connect(Object ignored)
                          at System.Threading.ThreadPool.WorkItem.doWork(Object o)
                          at System.Threading.Timer.ring()


    and here is the code i am using :

    ToServerSyncContractClient

     

    proxy = new ToServerSyncContractClient();
    ToServerSyncAgent myAgent = new ToServerSyncAgent(proxy);

    var

     

    stats = myAgent.Synchronize();

     

     



    My question is after setting up the WCF how can i access it and use it my my smartdeviceapplication to be able to synchronize using a button?

    Thank you in advance !!

    • Moved by Hengzhe Li Friday, April 22, 2011 2:39 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Wednesday, June 17, 2009 3:13 PM

Answers

All replies

  • Hi,

    Take a look at SyncComm project as well as Using WCF for Communcation in a Mobile Sync Application post. You have to modify WCF client proxy as describes MSF blog's post. You can see this proxy modified at synccomm project.

    Hope it helpfull

    Cheers,

    José Miguel Torres
    Friday, June 19, 2009 2:08 PM
  • Thank you so much if i got a problem i will post it back but it was very helpfull !!! ;)
    Monday, June 22, 2009 9:41 AM
  • I Was testing The syncComm project and i run into this problem i looked here : http://social.microsoft.com/Forums/en-US/uklaunch2007ado.net/thread/c9dd4b76-5afa-42aa-a81d-35abd512e645 but i could not figure out how to solve it !!

    Can you provide a simple solution / fix for using the Gzip Encoder and avoiding this problem ?!!


    Warning1 Element 'binding' has a none vaild child 'GZipMessageEncoding'. Possible element are : 'binaryMessageEncoding, compositeDuplex, oneWay, httpTransport, httpsTransport, msmqIntegration, msmqTransport, mtomMessageEncoding, namedPipeTransport, peerTransport, pnrpPeerResolver, privacyNoticeAt, reliableSession, security, sslStreamSecurity, tcpTransport, textMessageEncoding, windowsStreamSecurity, transactionFlow, unrecognizedPolicyAssertions, useManagedPresentation, webMessageEncoding, context'. C:\Documents and Settings\ahi\Bureau\synccomm0.90b\SyncComm Server\SyncComm.Service.Host\app.config 41 11 SyncComm.Service.Host

    Than you in advance !!!!
    Tuesday, June 23, 2009 10:08 AM
  • HI,

    You have to download GZipEncoder and reference it on SyncComm.Service.Host project as described in Home's project. See Discussion panel as well.

    Cheers
    José Miguel Torres
    Friday, June 26, 2009 1:03 PM
  • hi,
    if u still have problem follow the following link

    http://msdn.microsoft.com/en-us/library/dd938879.aspx


    see how to create proxy & edit it....also see the app.config..

    hope this will help u....
    • Marked as answer by more_fun18 Friday, July 17, 2009 12:58 PM
    Friday, July 17, 2009 11:46 AM