[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.4

setting up MaxReceivedMessageSize in App.Config for WCF

Asked by CMXUser in Web Services and WCF

I am using a sample project which is synching data through WCF Service and using Bidirectional Sync mentioned at the following url for a sample table of my own

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

I ran this for various test cases. I created 1000 rows on server and used Sync to transfer data to the client
I made changed in some of those data on the client and used the Sync to reflect those changes on the server

Then I added 200 new rows on client and used sync to send these rows back to the server

However when I added 300 new rows on client and used sync to send these rows back to the server i get the "TargetInvocationException" when i execute

Microsoft.Synchronization.Data.SyncStatistics stats = syncAgent.Synchronize();

following is the stack trace

   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 TestUI.Form1.button2_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
   at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
   at System.Windows.Forms.Application.Run(Form fm)
   at TestUI.Program.Main()

I found MaxReceivedMessageSize property to set up the upload limit
Now I have to figure out how to plug it in the following app.config. If any one has experience with this plz direct me
Thank you all for your time
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
  </configSections>
  <connectionStrings>
    <add name="WCFProxy.Properties.Settings.ServerNewQuestConnectionString"
      connectionString="Data Source=10.0.0.15\SQLEXPRESS;Initial Catalog=NewQuest;User ID=appuser;Password=appuser"
      providerName="System.Data.SqlClient" />
  </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 name="WCFProxy.Service1" behaviorConfiguration="WCFProxy.Service1Behavior" -->
      <service name="WCFProxy.ExceptionDetailsSyncService" behaviorConfiguration="WCFProxy.ExceptionDetailsSyncServiceBehavior">
        <host>
          <baseAddresses>
            <!-- add baseAddress="http://localhost:8731/Design_Time_Addresses/WCFProxy/Service1/"   / -->
            <add baseAddress="http://10.0.0.15:8731/WCFProxy/ExceptionDetailsSyncService/"   />
          </baseAddresses>
        </host>
        <!-- Service Endpoints -->
        <!-- Unless fully qualified, address is relative to base address supplied above -->
        <!--endpoint address=""  binding="wsHttpBinding" contract="WCFProxy.IService1" -->
        <endpoint address=""  binding="basicHttpBinding" contract="WCFProxy.IExceptionDetailsSyncContract">
          <!-- 
              Upon deployment, the following identity element should be removed or replaced to reflect the 
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
              automatically.
          -->
          <identity>
            <!-- dns value="localhost"/ -->
            <dns value="10.0.0.15"/>
          </identity>
        </endpoint>
        <!-- Metadata Endpoints -->
        <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> 
        <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <!--behavior name="WCFProxy.Service1Behavior" -->
        <behavior name="WCFProxy.ExceptionDetailsSyncServiceBehavior">
          <!-- 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>
[+][-]04/16/09 02:09 PM, ID: 24162634Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Web Services and WCF
Sign Up Now!
Solution Provided By: CMXUser
Participating Experts: 0
Solution Grade: A
 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625