2
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!
4

0 回答 0