none
wcf 操纵数据库更新 RRS feed

  • 问题

  • 我在使用WCF 往数据库里保存数据时,数据库里定义了一个字段为XML类型,当数据保存少的时候没有问题都正常,数据大的时候就一直报错,请大家指教下如何解决,都弄了2天没解决掉!!

    代码:
      EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "/Services/GetDataEntityService.svc"));
                    Shareidea.Web.UI.Control.Workflow.Designer.ConfigService.GetDataEntityServiceClient client = new Shareidea.Web.UI.Control.Workflow.Designer.ConfigService.GetDataEntityServiceClient(new BasicHttpBinding(), address);
                    client.SaveFlowConfigCompleted += new EventHandler<Shareidea.Web.UI.Control.Workflow.Designer.ConfigService.SaveFlowConfigCompletedEventArgs>(client_SaveFlowConfigCompleted);
                    client.SaveFlowConfigAsync(item);


     void client_SaveFlowConfigCompleted(object sender, Shareidea.Web.UI.Control.Workflow.Designer.ConfigService.SaveFlowConfigCompletedEventArgs e)
            {
                if (e.Result)
                {
                    System.Windows.Browser.HtmlPage.Window.Alert("保存成功!");
                }
                else
                {
                    System.Windows.Browser.HtmlPage.Window.Alert("保存失败!");
                }
            }



    异常:
    {System.Net.WebException: 远程服务器返回了错误: NotFound。
       位于 System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
       位于 System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
       位于 System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)}


    WCF  web.config配置:
     <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_IDataService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" textEncoding="UTF-8" sendTimeout="00:05:10" receiveTimeout="00:05:10" openTimeout="00:05:10" closeTimeout="00:05:10">
              <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
            </binding>
          </basicHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ShareDesigner.Web.Services.ModelStateBehavior">
              <serviceMetadata httpGetEnabled="true"  />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
            <behavior name="ShareDesigner.Web.GetDataEntityBehavior">
              <serviceTimeouts transactionTimeout="00:30:00" />
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
            <behavior name="ShareDesigner.Web.Services.GetDataEntityServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service behaviorConfiguration="ShareDesigner.Web.Services.ModelStateBehavior"
            name="ShareDesigner.Web.Services.ModelState" >
            <endpoint address="" binding="basicHttpBinding" contract="ShareDesigner.Web.WorkStateCfg"  />
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"  />


          </service>
          <service behaviorConfiguration="ShareDesigner.Web.GetDataEntityBehavior"
            name="ShareDesigner.Web.GetDataEntity">
            <endpoint address="" binding="basicHttpBinding" contract="ShareDesigner.Web.IGetDataEntity" >
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
          <service behaviorConfiguration="ShareDesigner.Web.Services.GetDataEntityServiceBehavior"
            name="ShareDesigner.Web.Services.GetDataEntityService">
            <endpoint address="" binding="basicHttpBinding"  contract="ShareDesigner.Web.Services.IGetDataEntityService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
      </system.serviceModel>
    </configuration>



    2010年1月31日 14:23

全部回复