2016-04-05 124 views
0

我做了一個WCF,它從ms sql db和外部WCF中獲取數據。 當我調試它工作正常,但一旦我嘗試它在現實世界中,我得到這個錯誤的服務:WCF參考外部Web服務

類型的未處理的異常「System.ServiceModel.FaultException`1」出現在mscorlib.dll

附加信息:在http://10.11.11.22/AIM/AIMIS處沒有可以接受消息的端點偵聽。這通常是由不正確的地址或SOAP操作引起的。有關更多詳細信息,請參閱InnerException(如果存在)。

一些在app.config的:

<bindings> 
    <basicHttpBinding> 
    <binding name="AdapterFacadeBinding" /> 
    </basicHttpBinding> 
</bindings> 
<client> 
    <endpoint address="http://10.11.11.22/AIM/AIMIS" binding="basicHttpBinding" 
    bindingConfiguration="AdapterFacadeBinding" contract="AIMISWS.AdapterFacadePortType" 
    name="AdapterFacadePort" /> 
</client> 
<services> 
    <service name="EcoGridIBMExport.CustomerService"> 
    <endpoint address="" binding="basicHttpBinding" contract="EcoGridIBMExport.ICustomerService"> 
     <identity> 
     <dns value="localhost" /> 
     </identity> 
    </endpoint> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://localhost:8733/Design_Time_Addresses/EcoGridIBMExport/Service1/" /> 
     </baseAddresses> 
    </host> 
    </service> 
</services> 

,並在客戶端應用程序連接我是這樣的:

static void Main(string[] args) 
{ 
    CustomerServiceClient client = new CustomerServiceClient(); 
    Console.WriteLine(client.GetMeter()); 
    Console.ReadLine(); 

    client.Close(); 
} 

我在做什麼錯?

+1

'請參閱InnerException(如果存在)以獲取更多詳細信息.'只需在異常處調用'ToString'即可獲得人們需要幫助的內容。它包含異常和所有內部異常的類型,消息和堆棧跟蹤。 – Will

+0

問題不在於您的客戶端連接到CustomerService,而是連接到AIMISWS服務的CustomerService存在問題 –

+0

這是您不會看到的: – TBoy3

回答

0

這是你不會看到什麼:

System.ServiceModel.FaultException`1 [System.ServiceModel.ExceptionDetail]:沒有終點的http://10.11.11.22/AIM/AIMIS聽,可以接受的消息。這通常是由不正確的地址或SOAP操作引起的。有關更多詳細信息,請參閱InnerException(如果存在)。 (Fejloplysningerne er lig med En ExceptionExetail,som sandsynligvis er oprettet af IncludeExceptionDetailInFaults = true,medværdien: System.ServiceModel.EndpointNotFoundException:在http://10.11.11.22/AIM/AIMIS上沒有可以接受消息的端點,這通常是由錯誤的地址或SOAP引起的action。如果存在,請參閱InnerException以獲取更多詳細信息----> System.Net.WebException:無法連接到遠程服務器----> System.Net.Sockets.SocketException:連接嘗試失敗,因爲連接一方在一段時間後沒有正確響應,或者由於連接主機未能響應而建立連接失敗10.11.11.22:80 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,SocketAddress socketAddress) at System.Net .ServicePoint.ConnectSocketInternal(布爾connectFailure,套接字s4,套接字s6,套接字&套接字,IP地址&地址,ConnectSocketState狀態,IAsyncResult asyncResult,異常&例外) --- Slutpåstaksporingen for oplysninger ...)。