2017-05-26 137 views
0

我的wcf服務正在工作,直到我做了兩個更改。當我在調試模式下運行它時,我沒有得到任何錯誤,但是當我將它部署到生產環境時,我得到了「無終點」異常。我遵循其他帖子中的建議,但沒有改變。任何人都可以幫我解決這個問題嗎?

1.添加接受字符串和一個字節數組System.ServiceModel.EndpointNotFoundException:在配置的URL上沒有監聽端點

 

Function method3(ByVal parameter1 As String, ByVal parameter2 As Byte()) As String


2.增加到web.config所以較大的消息可以被髮送的截面的方法

<bindings> 
 
    <basicHttpsBinding> 
 
    <binding maxReceivedMessageSize="2100000000"></binding> 
 
    </basicHttpsBinding> 
 
</bindings>

WCF服務配置

<system.serviceModel> 
    <bindings> 
     <!--This needs to be changed to http if debugging and https for production--> 
     <!--<basicHttpBinding> 
     <binding maxReceivedMessageSize="2100000000"></binding> 
     </basicHttpBinding>--> 
     <basicHttpsBinding> 
     <binding maxReceivedMessageSize="2100000000"></binding> 
     </basicHttpsBinding> 
    </bindings> 
    <services> 
     <service name="penergydata.penergydata"> 
     <host> 
      <baseAddresses> 
      <!--This needs to be changed to http if debugging and https for production--> 
      <!--<add baseAddress="http://localhost:49427/"/>--> 
      <add baseAddress="https://wcfservices.myefaactweb.com/penergydata/"></add> 
      </baseAddresses> 
     </host> 
     <!--This needs to be changed to http if debugging and https for production--> 
     <!--<endpoint address="" binding="basicHttpBinding" contract="penergydata.Ipenergydata"/>--> 
     <endpoint address="" binding="basicHttpsBinding" contract="penergydata.Ipenergydata"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, set the values below to false before deployment --> 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> 
      <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
      <serviceDebug includeExceptionDetailInFaults="false"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <protocolMapping> 
     <!--This needs to be changed to http if debugging and https for production--> 
     <!--<add binding="basicHttpBinding" scheme="http"/>--> 
     <add binding="basicHttpsBinding" scheme="https"/> 
    </protocolMapping> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/> 
    </system.serviceModel> 

客戶端配置

<system.serviceModel> 
 
\t <bindings> 
 
\t \t <basicHttpBinding> 
 
\t \t \t <binding name="BasicHttpsBinding_Ipenergydata"> 
 
\t \t \t \t <security mode="Transport"/> 
 
\t \t \t </binding> 
 
\t \t </basicHttpBinding> 
 
\t </bindings> 
 
\t <client> 
 
\t \t <endpoint address="https://wcfservices.myefaactweb.com/penergydata/penergydata.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpsBinding_Ipenergydata" contract="penergydata.Ipenergydata" name="BasicHttpsBinding_Ipenergydata"/> 
 
\t </client> 
 
</system.serviceModel>

+0

沒有「無」終點異常,它可能有多種原因。閱讀[問]和[mcve],完整地發佈錯誤,以及您嘗試解決問題的方式。 – CodeCaster

回答

0

確保您更改綁定類型的客戶端。客戶端和服務綁定必須匹配。您始終可以使用svcutil獲取服務的正確配置信息。

<system.serviceModel> 
    <bindings> 
     <basicHttpsBinding> 
      <binding name="BasicHttpsBinding_Ipenergydata"> 
       <security mode="Transport"/> 
      </binding> 
     </basicHttpsBinding> 
    </bindings> 
    <client> 
     <endpoint address="https://wcfservices.myefaactweb.com/penergydata/penergydata.svc" binding="basicHttpsBinding" bindingConfiguration="BasicHttpsBinding_Ipenergydata" contract="penergydata.Ipenergydata" name="BasicHttpsBinding_Ipenergydata"/> 
    </client> 
</system.serviceModel> 
+0

感謝您的迴應。客戶端使用.Net 3.5並且標記不可用。 –

相關問題