locked
Creating an Occasionally Connected Smart Device Application RRS feed

  • Question

  • Following this step by step procedure,i have managed to sync databases, using VS wcf service host tool(wcfsvchost.exe).I try to run this under IIS hosting,but i haven't succed.As you can see here i have created a web site to do that and calling the service with localhost is ok.
    The problem should be at client code,calling the service.I will provide you  the App.config code and the entire stack.
    Any guidness will be helpfull.
    Thanks in advance.


    The entire stack
    * 3/7/09 10:36:00 ?? | TargetInvocationException | ?? System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)
    ?? System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    ?? System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
    ?? Microsoft.Synchronization.Data.ServerSyncProviderProxy.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)
    ?? Microsoft.Synchronization.SyncAgent.DownloadChanges(SyncGroupMetadata groupMetadata)
    ?? Microsoft.Synchronization.SyncAgent.Synchronize()
    ?? mBiz.UI.Sync.SynchronizeMenuItem_Click(Object sender, EventArgs e)
    ?? System.Windows.Forms.MenuItem.OnClick(EventArgs e)
    ?? System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis, WM wm, Int32 wParam, Int32 lParam)
    ?? System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
    ?? System.Windows.Forms.Form.ShowDialog()
    ?? mBiz.UI.Main.lvwMenuSecond_SelectedIndexCommand()
    ?? mBiz.UI.Main.lvwMenuSecond_ItemActivate(Object sender, EventArgs e)
    ?? System.Windows.Forms.ListView.OnItemActivate(EventArgs e)
    ?? System.Windows.Forms.ListView.HandleItemActivate(Int32 iItem)
    ?? System.Windows.Forms.ListView.WnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
    ?? System.Windows.Forms.Form.ShowDialog()
    ?? mBiz.Logon._LogIn()
    ?? mBiz.Logon.Logon_Load(Object sender, EventArgs e)
    ?? System.Windows.Forms.Form.OnLoad(EventArgs e)
    ?? System.Windows.Forms.Form._SetVisibleNotify(Boolean fVis)
    ?? System.Windows.Forms.Control.set_Visible(Boolean value)
    ?? System.Windows.Forms.Form.ShowDialog()
    ?? mBiz.UI.Splash.Splash_Activated(Object sender, EventArgs e)
    ?? System.Windows.Forms.Form.OnActivated(EventArgs e)
    ?? System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? Microsoft.AGL.Forms.WL.SetVis(IntPtr hwnThis, BOOL fVis)
    ?? System.Windows.Forms.Control.set_Visible(Boolean value)
    ?? System.Windows.Forms.Application.Run(Form fm)
    ?? mBiz.Program.Main()
    
    * 3/7/09 10:36:01 ?? | Unable to read data from the transport connection. | ?? System.Net.HttpWebRequest.finishGetResponse()
    ?? System.Net.HttpWebRequest.GetResponse()
    ?? System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
    ?? System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
    ?? System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke(String methodName, Object[] parameters, WebClientAsyncResult asyncResult)
    ?? mBiz.mBizCacheWebRef.mBizCacheSyncService.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)
    ?? System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
    ?? System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess, StackCrawlMark& stackMark)
    ?? System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    ?? System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
    ?? Microsoft.Synchronization.Data.ServerSyncProviderProxy.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)
    ?? Microsoft.Synchronization.SyncAgent.DownloadChanges(SyncGroupMetadata groupMetadata)
    ?? Microsoft.Synchronization.SyncAgent.Synchronize()
    ?? mBiz.UI.Sync.SynchronizeMenuItem_Click(Object sender, EventArgs e)
    ?? System.Windows.Forms.MenuItem.OnClick(EventArgs e)
    ?? System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis, WM wm, Int32 wParam, Int32 lParam)
    ?? System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
    ?? System.Windows.Forms.Form.ShowDialog()
    ?? mBiz.UI.Main.lvwMenuSecond_SelectedIndexCommand()
    ?? mBiz.UI.Main.lvwMenuSecond_ItemActivate(Object sender, EventArgs e)
    ?? System.Windows.Forms.ListView.OnItemActivate(EventArgs e)
    ?? System.Windows.Forms.ListView.HandleItemActivate(Int32 iItem)
    ?? System.Windows.Forms.ListView.WnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
    ?? System.Windows.Forms.Form.ShowDialog()
    ?? mBiz.Logon._LogIn()
    ?? mBiz.Logon.Logon_Load(Object sender, EventArgs e)
    ?? System.Windows.Forms.Form.OnLoad(EventArgs e)
    ?? System.Windows.Forms.Form._SetVisibleNotify(Boolean fVis)
    ?? System.Windows.Forms.Control.set_Visible(Boolean value)
    ?? System.Windows.Forms.Form.ShowDialog()
    ?? mBiz.UI.Splash.Splash_Activated(Object sender, EventArgs e)
    ?? System.Windows.Forms.Form.OnActivated(EventArgs e)
    ?? System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
    ?? Microsoft.AGL.Forms.WL.SetVis(IntPtr hwnThis, BOOL fVis)
    ?? System.Windows.Forms.Control.set_Visible(Boolean value)
    ?? System.Windows.Forms.Application.Run(Form fm)
    ?? mBiz.Program.Main()
    
    



    The App.config from MiddleTierServiceLibrary project
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <configSections>
      </configSections>
      <connectionStrings>
        <add name="MiddleTierServiceLibrary.Properties.Settings.ServerDemoMSalesConnectionString"
          connectionString="Data Source=!!!!!!;Initial Catalog=!!!!!!;User ID=!!!!!!;Password=!!!!!!"
          providerName="System.Data.SqlClient" />
        <add name="MiddleTierServiceLibrary.Properties.Settings.ClientDemoMSalesConnectionString"
          connectionString="!!!!!!;Max Database Size=2047"
          providerName="Microsoft.SqlServerCe.Client.3.5" />
      </connectionStrings>
      <system.web>
        <compilation debug="true" />
      </system.web>
      <!-- When deploying the service library project, the content of the config file must be added to the host's 
      app.config file. System.Configuration does not support config files for libraries. -->
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="MiddleTierServiceLibrary.mBizCacheSyncServiceBehavior"
            name="MiddleTierServiceLibrary.mBizCacheSyncService">
            <endpoint address="" binding="basicHttpBinding" contract="MiddleTierServiceLibrary.ImBizCacheSyncContract"/>
              <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    
            <host>
              <baseAddresses>
                <add baseAddress="http://myIP/mBizCacheSyncService/" />           
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="MiddleTierServiceLibrary.mBizCacheSyncServiceBehavior">
              <!-- To avoid disclosing metadata information, 
              set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="True"/>
              <!-- To receive exception details in faults for debugging purposes, 
              set the value below to true.  Set to false before deployment 
              to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="True" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    </configuration>
    <br/><br/><br/><br/>
    
    • Moved by Hengzhe Li Friday, April 22, 2011 2:39 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Friday, July 3, 2009 8:06 AM

Answers

  • can you invoke the web servce form the device ? if you do , is this the same url you used in your application ?

    thanks
    Yunwen
    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by makis_g3 Friday, July 17, 2009 12:29 PM
    Monday, July 6, 2009 7:04 AM
    Moderator

All replies

  • can you invoke the web servce form the device ? if you do , is this the same url you used in your application ?

    thanks
    Yunwen
    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by makis_g3 Friday, July 17, 2009 12:29 PM
    Monday, July 6, 2009 7:04 AM
    Moderator
  • hi,

    have u used

    <add baseAddress="http://myIP/mBizCacheSyncService/"

    above address for calling it from device.....hope u have started the active sync also...

    plz give the endpoint & BasicHttpBinding -

    System.ServiceModel.

    BasicHttpBinding basicBinding = new System.ServiceModel.BasicHttpBinding();

    System.ServiceModel.

    EndpointAddress endPoint = new System.ServiceModel.EndpointAddress("http://myIP/mBizCacheSyncService/");

    ContractClient

     

    proxy = new ContractClient(basicBinding, endPoint);

    hopw this will help u..

    Friday, July 17, 2009 11:41 AM