0
消耗WCF服務
我在VS2012
中創建了一個WCF Service Library
,並將其加載到我的本地IIS
。
我的客戶端是Windows-Mobile 6.5
設備,客戶端的配置文件是使用netcfsvcutil.exe
生成的。在調試過程中一切正常,但當我將服務上傳到外部IIS
時,即使netcfsvcutil.exe
從外部URL生成文件,我仍然收到There was no endpoint listening...
例外。這是web.config
文件所在的遠程服務器上:從IIS
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="TestBinding" receiveTimeout="00:01:00" sendTimeout="00:01:00">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="MyService.CollectionService">
<endpoint address="" binding="basicHttpBinding" contract="MyService.ICollectionService" bindingConfiguration="TestBinding">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/MyService/CollectionService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
和客戶端端點這樣產生:
public static System.ServiceModel.EndpointAddress EndpointAddress =
new System.ServiceModel.EndpointAddress("http://1.2.3.4/MyService/MyService.CollectionService.svc");
當我上傳的我尚未進行任何配置變化服務到外部IIS
,我只是複製&將文件從一個虛擬目錄粘貼到另一個。 可能有所幫助的一點是,異常在沒有超時的情況下引發。