【发布时间】:2014-02-23 21:59:45
【问题描述】:
我有一个 WCF Web 服务,我可以从 Visual Studio IIS 服务器中的 Android 应用程序调用它,但现在在我的本地 IIS 服务器中发布该服务后,当我尝试从应用程序进行调用时,我收到以下信息错误作为响应: “HTTP 错误 404.0 - 您要查找的资源已被删除、名称已更改或暂时不可用。” ISAPI 和 CGI 限制都是允许的 *从浏览器中的 URL 调用服务正常工作* 这是我第一次尝试制作服务出版物,欢迎任何帮助。
我的 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>
【问题讨论】:
标签: android visual-studio-2010 wcf iis-7.5