System.Net.WebException: The remote server returned an error: NotFound.
-
יום רביעי 17 אוגוסט 2011 08:01
Hi
I am using Sync Framework 4.0 CTP Release and i created application for synchronising between two SQL server 2008 database. I was following the steps given in the forum http://msdn.microsoft.com/en-us/library/gg299026(v=SQL.110).aspx with slight changes like i didnt use filter conditions and also i am using "SyncSvcUtilHelper.exe" to create the Sync configuration and provisioning the database and for code generation also.
As mentioned i created a Silver light application on my client side but when iam trying to run the application i am getting this error
{System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)
--- End of inner exception stack trace ---
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.Synchronization.ClientServices.HttpCacheRequestHandler.OnDownloadGetResponseCompleted(IAsyncResult asyncResult)} System.Exception {System.Net.WebException}Below is the my xaml code which is used in my Silverlight application.
using System; using System.Net; using System.Windows; using System.Windows.Controls; using DestinationScope; using Microsoft.Synchronization.ClientServices.IsolatedStorage; namespace SyncClientSilverlight { public partial class MainPage : UserControl { DestinationScopeOfflineContext context = null; public MainPage() { InitializeComponent(); context = new DestinationScopeOfflineContext("Client", new Uri(new Uri(new WebClient().BaseAddress), "../SourceScopeSyncService.svc/")); context.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(context_LoadCompleted); this.Loaded += new RoutedEventHandler(MainPage_Loaded); context.CacheController.RefreshCompleted += (sender, args) => { if (args.Error != null) { Dispatcher.BeginInvoke( delegate { MessageBox.Show(args.Error.ToString()); }); } }; } void MainPage_Loaded(object sender, RoutedEventArgs e) { context.LoadAsync(); } void context_LoadCompleted(object sender, LoadCompletedEventArgs e) { Dispatcher.BeginInvoke(delegate { TagsGrid.ItemsSource = context.SourceCollection; }); } private void Button_Click(object sender, RoutedEventArgs e) { // saves any outstanding changes made by the application context.SaveChanges(); // refreshes the cache by uploading all modified changes and then by downloading the server changes context.CacheController.RefreshAsync(); } } }
Below is my Server Side Sync Configuration
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="SyncConfiguration" type="Microsoft.Synchronization.ClientServices.Configuration.SyncConfigurationSection, SyncSvcUtil, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" allowLocation="true" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" overrideModeDefault="Allow" restartOnExternalChanges="true" requirePermission="true" /> </configSections> <SyncConfiguration> <SyncScopes> <SyncScope Name="SourceScope" SchemaName="" IsTemplateScope="false" EnableBulkApplyProcedures="false"> <SyncTables> <SyncTable Name="[Source]" GlobalName="Source" SchemaName="" IncludeAllColumns="true" FilterClause=""> <SyncColumns> <SyncColumn Name="Contact_id" GlobalName="Contact_id" SqlType="int" IsPrimaryKey="true" IsNullable="false" /> <SyncColumn Name="first_name" GlobalName="first_name" SqlType="nvarchar" IsPrimaryKey="false" IsNullable="false" /> <SyncColumn Name="last_name" GlobalName="last_name" SqlType="nvarchar" IsPrimaryKey="false" IsNullable="false" /> </SyncColumns> </SyncTable> </SyncTables> </SyncScope> </SyncScopes> <Databases> <TargetDatabase Name="Source" DbServer="IIS08TOPSDEVDB1\IIS08TOPSDEVDB1" DbName="SyncSource" UserName="asapteam" Password="welcome" UseIntegratedAuth="false" /> </Databases> </SyncConfiguration> </configuration>
Below is my Client Side Sync Configuration
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="SyncConfiguration" type="Microsoft.Synchronization.ClientServices.Configuration.SyncConfigurationSection, SyncSvcUtil, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" allowLocation="true" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" overrideModeDefault="Allow" restartOnExternalChanges="true" requirePermission="true" /> </configSections> <SyncConfiguration> <SyncScopes> <SyncScope Name="DestinationScope" SchemaName="" IsTemplateScope="false" EnableBulkApplyProcedures="false"> <SyncTables> <SyncTable Name="[Source]" GlobalName="Source" SchemaName="" IncludeAllColumns="true" FilterClause=""> <SyncColumns> <SyncColumn Name="Contact_id" GlobalName="Contact_id" SqlType="int" IsPrimaryKey="true" IsNullable="false" /> <SyncColumn Name="first_name" GlobalName="first_name" SqlType="nvarchar" IsPrimaryKey="false" IsNullable="false" /> <SyncColumn Name="last_name" GlobalName="last_name" SqlType="nvarchar" IsPrimaryKey="false" IsNullable="false" /> </SyncColumns> </SyncTable> </SyncTables> </SyncScope> </SyncScopes> <Databases> <TargetDatabase Name="Destination" DbServer="IIS08TOPSDEVDB1\IIS08TOPSDEVDB1" DbName="SyncDestination" UserName="asapteam" Password="welcome" UseIntegratedAuth="false" /> </Databases> </SyncConfiguration> </configuration>
NOTE: The service indivisually is working fine.
Can you guys help me in fixing this. Please free to ask me if you need any more files for viewing or the source code for that matter.
כל התגובות
-
יום רביעי 17 אוגוסט 2011 08:27מנחה דיון
the above error can be caused by many other things. use fiddler to sniff the traffic and figure out the underlying error.
some useful links:
http://social.msdn.microsoft.com/Forums/en/synclab/thread/c5a271b1-ebeb-447b-9a90-4ae72c1b68b3
http://msdn.microsoft.com/en-us/library/gg299045(SQL.110).aspxhttp://msdn.microsoft.com/en-us/library/gg298998(SQL.110).aspx
http://msdn.microsoft.com/en-us/library/gg298994(SQL.110).aspx
-
יום רביעי 17 אוגוסט 2011 10:10
Thanks June
I tried diagnosing the webservice and found this error.
ClientAccessPolicy.xml/CrossDomain.xml files FAILED Could not find clientaccesspolicy.xml or crossdomain.xml file. Silverlight clients invoking the service from another domain will be unable to make requests successfully. Any help in this June. Thanks in advance.
-
יום רביעי 17 אוגוסט 2011 10:31מנחה דיון
that's a Silverlight specific error already. check out how to go about it here: http://msdn.microsoft.com/en-us/library/cc197955(v=vs.95).aspx
or check this out: http://social.msdn.microsoft.com/Forums/ar/synclab/thread/f20c0d74-2f81-4456-a232-53b5a568af9c
- סומן כתשובה על-ידי Sid Singh [MSFT]Microsoft Employee, Owner יום רביעי 31 אוגוסט 2011 05:04
-
יום שני 26 דצמבר 2011 07:33
Hi
I have the same problem.I am struggling since 2 days to fix it .
My Wcfservice is not hosted in IIS,Running in VS2010
Asyc() method is fine but when completed() method is calling I am getting this error .
I have added the crossdomain.xml and clientaccesspolicy.xml in my project and the project root folder.
ServiceReferences.ClientConfig
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:59591/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1" contract="EmployeeService.IService1"
name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>
Can anyone help me out please?
Thanks
Chittaranjan
- הוצע כתשובה על-ידי Chittaranjan Nahak יום שני 26 דצמבר 2011 10:51
- הצעה כתשובה בוטלה על-ידי Chittaranjan Nahak יום שני 26 דצמבר 2011 10:54
-
יום שני 26 דצמבר 2011 10:53
What I have done is while debugging the application , I just attacted the Wcfservice and It works for me now.(debug->attach Process->attach the wcfservice(for me it was running in the 59591 port)
Thanks
Chittaranjan
- הוצע כתשובה על-ידי Chittaranjan Nahak יום שני 26 דצמבר 2011 10:55