2017-11-27 23 views
0

私は非常に奇妙な問題があります。私はいくつかのサービス参照との接続を持つプログラムを構築します。 昨日まではうまくいっていました。私はこの場合、私はギリシャ語で例外を持っているため、エラーの正確な翻訳を知らないデフォルトの要素が見つかりませんでした。C#

System.InvalidOperationException: Could not find default endpoint element that references contract 'DateMovementRetrievalServiceProduction.DateMovementRetrievalPortType' in the service model client ServiceModel section. This might be because no configuaration file was found for your application or because no end point element matching this contract could be found in the client element 
in System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName) 
    in System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName, Configuration configuration) 
    in System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName) 
    in System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address) 
    in System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress) 
    in System.ServiceModel.ConfigurationEndpointTrait`1.CreateSimplexFactory() 
    in System.ServiceModel.ConfigurationEndpointTrait`1.CreateChannelFactory() 
    in System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait) 
    in System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef() 
    in System.ServiceModel.ClientBase`1..ctor() 
    in WcfWsClient.DateMovementRetrievalServiceProduction.DateMovementRetrievalPortTypeClient..ctor() in \IcisNet.WcfWsClient\Service References\DateMovementRetrievalServiceProduction\Reference.cs:line 837 
    in IcisNet.WcfWsClient.DateMovementRetrievalProductionClient.RetrieveDateMovements(IcisNetSecurityToken token, DateTime dateFrom, DateTime dateTo, DomainRolesIcisNet domainRole, DomainsIcisNet domain) in IcisNet.WcfWsClient\DateMovementRetrievalProductionClient.cs:line 15 
    in IE.Forms.IcisNetStatusForm.GetIcisNetMessagesByDates() in IE.Forms\IcisNetStatusForm.cs:line 120 

を私は何が起こったのかわからないし、今私は、これらのサービスと通信しようとすると、それは私にエラーを与えます。 面白いのは、プログラムがVisual Studioのdebbugingの下で正常に動作することですが、\ debug \ folderから実行可能ファイルを実行する場合にのみ例外が表示されます。

私はbitbucketからリバースコミットしようとしましたが、それでもエラーが表示されます。以前のビルドから実行可能ファイルを実行するとうまく動作します。 IDateMovementRetrievalServiceContract IDateMovementRetrievalServiceContract

 public List<RetrieveMovementInfo> RetrieveDateMovements(IcisNetSecurityToken token, DateTime dateFrom, DateTime dateTo, 
      DomainRolesIcisNet domainRole, DomainsIcisNet domain) 
     { 
      using (DateMovementRetrievalPortTypeClient client = new DateMovementRetrievalPortTypeClient()) 
      { 

       //Production enviroment force TLS 1.2 
. 
. 
. 
の { #region実装:DateMovementRetrievalServiceProduction \ Reference.csラインファイルDateMovementRetrievalProductionClient.csラインで833から855

[System.Diagnostics.DebuggerStepThroughAttribute()] 
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] 
    public partial class DateMovementRetrievalPortTypeClient : System.ServiceModel.ClientBase<Ektelonistis.IcisNet.WcfWsClient.DateMovementRetrievalServiceProduction.DateMovementRetrievalPortType>, Ektelonistis.IcisNet.WcfWsClient.DateMovementRetrievalServiceProduction.DateMovementRetrievalPortType { 

     public DateMovementRetrievalPortTypeClient() { 
     } 

     public DateMovementRetrievalPortTypeClient(string endpointConfigurationName) : 
       base(endpointConfigurationName) { 
     } 

     public DateMovementRetrievalPortTypeClient(string endpointConfigurationName, string remoteAddress) : 
       base(endpointConfigurationName, remoteAddress) { 
     } 

     public DateMovementRetrievalPortTypeClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
       base(endpointConfigurationName, remoteAddress) { 
     } 

     public DateMovementRetrievalPortTypeClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
       base(binding, remoteAddress) { 
     } 

8-18 パブリッククラスDateMovementRetrievalProductionClientで

およびファイルIcisNetStatusForm.cs行110-120

IDateMovementRetrievalServiceContract client = DateMovementRetrievalFactory. 
        GetDateMovementRetrievalService(
         Parameters.Config.IsTestService ? MessageServiceType.Test : MessageServiceType.Production); 

       string afm = DefaultDiasafistis.DiasafistisDefault.Afm; 

       if ((int)lookUpEditEvrosAnazitisis.EditValue == 1 && 
        lookUpEditPelates.EditValue != null) 
        afm = lookUpEditPelates.EditValue.ToString(); 

       List<RetrieveMovementInfo> movementInfos = client.RetrieveDateMovements(new IcisNetSecurityToken 

、最終的にこの問題が発生することが、なぜ私が検索し、回答のほとんどは、それはapp.configをとは何かを持っている、これは私のapp.configを

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="MyConfigBinding" maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
     </binding> 
     <binding name="TimeServiceImplPortBinding" 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="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      <security mode="Transport"> 
      <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> 
      <message clientCredentialType="UserName" algorithmSuite="Default" /> 
      </security> 
     </binding> 
     <binding name="TimeServiceImplPortBinding1" 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="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      <security mode="None"> 
      <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> 
      <message clientCredentialType="UserName" algorithmSuite="Default" /> 
      </security> 
     </binding> 
     </basicHttpBinding> 
     <customBinding> 
     <binding name="MessageProcessorPortBinding"> 
      <security defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" includeTimestamp="true" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> 
      <secureConversationBootstrap /> 
      </security> 
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      </textMessageEncoding> 
      <httpsTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" requireClientCertificate="false" /> 
     </binding> 
     <binding name="MovementRetrievalPortBinding"> 
      <security defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" securityHeaderLayout="Lax" includeTimestamp="true" keyEntropyMode="CombinedEntropy" messageSecurityVersion="Default"> 
      <secureConversationBootstrap /> 
      </security> 
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      </textMessageEncoding> 
      <httpsTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" requireClientCertificate="false" /> 
     </binding> 
     <binding name="DateMovementRetrievalPortBinding"> 
      <security defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" securityHeaderLayout="Lax" includeTimestamp="true" keyEntropyMode="CombinedEntropy" messageSecurityVersion="Default"> 
      <secureConversationBootstrap /> 
      </security> 
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      </textMessageEncoding> 
      <httpsTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" requireClientCertificate="false" /> 
     </binding> 
     <binding name="MessageProcessorPortBinding1"> 
      <security defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" includeTimestamp="true" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> 
      <secureConversationBootstrap /> 
      </security> 
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      </textMessageEncoding> 
      <httpsTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" requireClientCertificate="false" /> 
     </binding> 
     <binding name="MovementRetrievalPortBinding1"> 
      <security defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" securityHeaderLayout="Lax" includeTimestamp="true" keyEntropyMode="CombinedEntropy" messageSecurityVersion="Default"> 
      <secureConversationBootstrap /> 
      </security> 
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      </textMessageEncoding> 
      <httpsTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" requireClientCertificate="false" /> 
     </binding> 
     <binding name="DateMovementRetrievalPortBinding1"> 
      <security defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" securityHeaderLayout="Lax" includeTimestamp="true" keyEntropyMode="CombinedEntropy" messageSecurityVersion="Default"> 
      <secureConversationBootstrap /> 
      </security> 
      <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap11" writeEncoding="utf-8"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      </textMessageEncoding> 
      <httpsTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" requireClientCertificate="false" /> 
     </binding> 
     </customBinding> 
    </bindings> 
    <client> 
     <endpoint bindingConfiguration="MyConfigBinding" name="SignInvoice" address="http://localhost:8731/SignHere" binding="basicHttpBinding" contract="Sign.Contracts.ISignDocument" /> 
     <endpoint address="https://www2.gsis.gr:443/wsicisnet/MessageProcessorService" binding="customBinding" bindingConfiguration="MessageProcessorPortBinding" contract="MessageProcessorServiceTest.MessageProcessorPortType" name="MessageProcessorPort" /> 
     <endpoint address="https://www2.gsis.gr:443/wsicisnet/MovementRetrievalService" binding="customBinding" bindingConfiguration="MovementRetrievalPortBinding" contract="MovementRetrievalServiceTest.MovementRetrievalPortType" name="MovementRetrievalPort" /> 
     <endpoint address="https://www2.gsis.gr:443/wsicisnet/DateMovementRetrievalService" binding="customBinding" bindingConfiguration="DateMovementRetrievalPortBinding" contract="DateMovementRetrievalServiceTest.DateMovementRetrievalPortType" name="DateMovementRetrievalPort" /> 
     <endpoint address="https://www1.gsis.gr:443/wsicisnet/MessageProcessorService" binding="customBinding" bindingConfiguration="MessageProcessorPortBinding1" contract="MessageProcessorServiceProduction.MessageProcessorPortType" name="MessageProcessorPort1" /> 
     <endpoint address="https://www1.gsis.gr:443/wsicisnet/MovementRetrievalService" binding="customBinding" bindingConfiguration="MovementRetrievalPortBinding1" contract="MovementRetrievalServiceProduction.MovementRetrievalPortType" name="MovementRetrievalPort1" /> 
     <endpoint address="https://www1.gsis.gr:443/wsicisnet/DateMovementRetrievalService" binding="customBinding" bindingConfiguration="DateMovementRetrievalPortBinding1" contract="DateMovementRetrievalServiceProduction.DateMovementRetrievalPortType" name="DateMovementRetrievalPort1" /> 
     <endpoint address="https://www2.gsis.gr:443/wsicisnet/TimeService" binding="basicHttpBinding" bindingConfiguration="TimeServiceImplPortBinding" contract="TimeServiceTest.TimeServiceImpl" name="TimeServiceImplPort" /> 
     <endpoint address="https://www1.gsis.gr:443/wsicisnet/TimeService" binding="basicHttpBinding" bindingConfiguration="TimeServiceImplPortBinding1" contract="TimeServiceProduction.TimeServiceImpl" name="TimeServiceImplPort1" /> 
    </client> 
    </system.serviceModel> 
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
</configuration> 
+0

サービスが利用可能であることを確認しましたか?それとも失敗したのですか? – phuzi

+0

はいこれらのサービスは利用可能で、ビジュアルスタジオ – rippergr

+0

からプログラムを実行するときに使用します。デバッグモードで実行しているときに/ debugフォルダにアプリケーション設定が含まれていることを確認しましたか? – codemaker

答えて

0

OKであることを言う私が見つかりましたので、問題。 app.configなどとは関係がありませんでした。 問題はプログラムをロックするために使用したプログラムで、何らかの理由でサービスとの通信をブロックしていました。 ありがとうございました

関連する問題