У меня есть один веб-проект, который использует веб-службы wcf, и он не работает нормально.
здесь я включаю файл веб-конфигурации для более глубокого понимания:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="FolderPath" value="excel/"/>
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;"/>
</appSettings>
<system.Web>
<httpRuntime targetFramework="4.6.1" />
</system.Web>
<system.web>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<compilation debug="true" targetFramework="4.6.1">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
</compilation>
<httpRuntime maxRequestLength="2147483647" executionTimeout="99999999"/>
<pages>
<controls>
<add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
</system.web>
<system.webServer>
<defaultDocument>
<files>
<clear/>
<add value="Login.aspx"/>
</files>
</defaultDocument>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="ChartImageHandler"/>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="LargeWeb" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" sendTimeout="infinite">
<readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="32" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
</binding>
</webHttpBinding>
</bindings>
<client>
<endpoint address="http://staffapi.vayak.net/staff_care_wcf_ws/RestServiceImpl.svc" binding="webHttpBinding" bindingConfiguration="LargeWeb" contract="SC_WCF.IRestServiceImpl" name="" behaviorConfiguration="web"/>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
когда приложение запрашивает, то оно даетмне ошибка, как этот пост заголовок
здесь я включаю мой метод для вызова этих услуг.
public void Fill_Combo(Page pg, DropDownList ddl, string combo_type, int Active_Only = 1, int Help_ID = 0, int All_Req = 1, string All_Str = "All", string Filter_Str = "")
{
cls_combo obj = new cls_combo();
cls_combo[] obj_li = null;
try
{
cls_combo_in obj_in = new cls_combo_in();
obj_in.db_name = CommonLogic.GetSessionValue("sdb_name");
obj_in.Combo_Type = combo_type;
obj_in.Active_Only = Active_Only;
obj_in.help_id = Help_ID;
obj_in.Add_Str_Req = All_Req;
obj_in.Add_Str = All_Str;
obj_in.Staff_ID = Convert.ToInt32(CommonLogic.GetSessionValue("staff_id"));
obj_in.Is_Admin = Convert.ToBoolean(CommonLogic.GetSessionValue("is_admin")) == true ? 1 : 0;
obj_li = obj_main.get_combo(obj_in);
if (obj_li.Length > 0)
{
ddl.DataSource = obj_li;
ddl.DataTextField = "Value";
ddl.DataValueField = "ID";
ddl.DataBind();
}
else
{
CommonLogic.SetSessionValue("combo_type", combo_type);
pg.Response.Redirect("alert.aspx");
}
}
catch (Exception ex)
{
CommonLogic.SendMailOnError(ex);
}
}
я не понимаю, что здесь не так, пожалуйста, помогите мне, ребята ..