我有一個WCF Web服務,我可以從一個Android應用程序在Visual Studio IIS服務器中調用,但現在在我的本地IIS服務器上發佈服務後,當我嘗試製作一個來自應用程序的調用我收到以下錯誤作爲響應: 「HTTP錯誤404.0 - 您正在查找的資源已被刪除,名稱已更改或暫時不可用。」 的ISAPI和CGI限制都是允許 * 從瀏覽器的URL調用服務工作正常 * 這是我第一次嘗試做一個服務發佈,任何幫助將受到歡迎。HTTP錯誤404.0 - 未找到IIS 7.5
我的web.config文件:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<connectionStrings>
<add name="VendasEntities" connectionString="metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=SERVER IP;User Id=user;password=pass;Persist Security Info=True;database=database"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="httpBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="FreedomVendasService.VendasService">
<endpoint address="" behaviorConfiguration="httpBehavior" binding="webHttpBinding" contract="FreedomVendasService.IVendasService" />
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:\log\Traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
<host>
<baseAddresses>
<add baseAddress = "http://localhost/VendasService" />
</baseAddresses>
</host>
</configuration>
現在,我收到這樣的信息:「這是不可能讀‘主機’的配置,因爲一節聲明失蹤」 –
我更新我的職務與網絡.config文件 –