找不到引用合同的默认端点元素

发布于 2024-11-26 01:20:23 字数 4986 浏览 4 评论 0原文

I am trying to solve connection problem, I've already spent more hours than expected and ended nowhere.

Error:
Could not find default endpoint element that references contract 'timeedit3' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

Stacktrace:


[InvalidOperationException: Could not find default endpoint element that references contract 'timeedit3' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.]
   System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName) +15858380
   System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address) +95
   System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress) +291
   System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName) +12
   System.ServiceModel.EndpointTrait`1.CreateSimplexFactory() +15623711
   System.ServiceModel.EndpointTrait`1.CreateChannelFactory() +18
   System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait) +20
   System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef() +436
   System.ServiceModel.ClientBase`1..ctor() +211
   timeedit3Client..ctor() +41
   LUSEM.SharePoint.Utils.DataAccess.TimeEdit3..ctor() +125
   LUSEM.SharePoint.WebParts.Administration.TEUpdateAndModify.TEUpdateAndModifyUserControl..ctor() +77
   ASP._controltemplates_lusem_sharepoint_webparts_administration_teupdateandmodify_teupdateandmodifyusercontrol_ascx..ctor() in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\1f0e5a2f\af1522bf\App_Web_z__cuvts.0.cs:0
   __ASP.FastObjectFactory_app_web_z__cuvts.Create_ASP__controltemplates_lusem_sharepoint_webparts_administration_teupdateandmodify_teupdateandmodifyusercontrol_ascx() in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\1f0e5a2f\af1522bf\App_Web_z__cuvts.1.cs:0
   System.Web.UI.TemplateControl.LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, Object[] parameters) +192
   System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) +110
   LUSEM.SharePoint.WebParts.Administration.TEUpdateAndModify.TEUpdateAndModify.CreateChildControls() +95
   System.Web.UI.Control.EnsureChildControls() +146
   System.Web.UI.Control.PreRenderRecursiveInternal() +61
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394





App.Config:





  <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
           <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                  <binding name="timeedit3_portBinding" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                  <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                      maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                  <security mode="Transport">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                  </security>
                </binding>
              </basicHttpBinding>
            </bindings>
            <client>
    <endpoint address="https://web.timeedit.se/lu_test/soap/db1/2/" binding="basicHttpBinding" bindingConfiguration="timeedit3_portBinding" contract="timeedit3" name="timeedit3_port" />
            </client>
        </system.serviceModel>
    </configuration> 





Creating constructor:
private timeedit3Client te3c = new timeedit3Client();

Using the same code structure on a windows client runs fine, but in a webpart this problem occures.

Please Help me!
I am trying to solve connection problem, I've already spent more hours than expected and ended nowhere.

Error:
Could not find default endpoint element that references contract 'timeedit3' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

Stacktrace:


[InvalidOperationException: Could not find default endpoint element that references contract 'timeedit3' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.]
   System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName) +15858380
   System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address) +95
   System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress) +291
   System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName) +12
   System.ServiceModel.EndpointTrait`1.CreateSimplexFactory() +15623711
   System.ServiceModel.EndpointTrait`1.CreateChannelFactory() +18
   System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait) +20
   System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef() +436
   System.ServiceModel.ClientBase`1..ctor() +211
   timeedit3Client..ctor() +41
   LUSEM.SharePoint.Utils.DataAccess.TimeEdit3..ctor() +125
   LUSEM.SharePoint.WebParts.Administration.TEUpdateAndModify.TEUpdateAndModifyUserControl..ctor() +77
   ASP._controltemplates_lusem_sharepoint_webparts_administration_teupdateandmodify_teupdateandmodifyusercontrol_ascx..ctor() in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\1f0e5a2f\af1522bf\App_Web_z__cuvts.0.cs:0
   __ASP.FastObjectFactory_app_web_z__cuvts.Create_ASP__controltemplates_lusem_sharepoint_webparts_administration_teupdateandmodify_teupdateandmodifyusercontrol_ascx() in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\1f0e5a2f\af1522bf\App_Web_z__cuvts.1.cs:0
   System.Web.UI.TemplateControl.LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, Object[] parameters) +192
   System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) +110
   LUSEM.SharePoint.WebParts.Administration.TEUpdateAndModify.TEUpdateAndModify.CreateChildControls() +95
   System.Web.UI.Control.EnsureChildControls() +146
   System.Web.UI.Control.PreRenderRecursiveInternal() +61
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394





App.Config:





  <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
           <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                  <binding name="timeedit3_portBinding" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                  <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                      maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                  <security mode="Transport">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                  </security>
                </binding>
              </basicHttpBinding>
            </bindings>
            <client>
    <endpoint address="https://web.timeedit.se/lu_test/soap/db1/2/" binding="basicHttpBinding" bindingConfiguration="timeedit3_portBinding" contract="timeedit3" name="timeedit3_port" />
            </client>
        </system.serviceModel>
    </configuration> 





Creating constructor:
private timeedit3Client te3c = new timeedit3Client();

Using the same code structure on a windows client runs fine, but in a webpart this problem occures.

Please Help me!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文