在我的公司,我们已经在Windows Server 2008上build立了一个活动域控制器,还有另一个Windows服务器来存储我们的文件并安装TFS和SQL Server,并且我们在一个域上有几台客户机。
我有一个多层的Windows应用程序,一层是一个web服务项目,包括“AppWebService.asmx”。 Web服务是一组读取/写入位于Windows Server 2012上的SQL Server的函数。
作为testing,我发布了(文件系统)web服务项目,把输出文件存储在我们服务器上的IIS中,然后在服务器上安装了Windows应用程序,并使用已发布的Web服务运行良好。
现在我想在所有的域计算机上安装Windows应用程序,并使他们使用位于我们的服务器上的IIS相同的Web服务,但我不断收到以下错误:
在http://localhost/App/AppWebService.asmx上没有可以接受消息的端点。 这通常是由不正确的地址或SOAP操作引起的。
虽然如果在服务器上冲浪到“ http://localhost/App/AppWebService.asmx ”,我可以看到包含在其中的方法。
这是我的App.config(在Windows应用程序的主要项目):
<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> </configSections> <connectionStrings> <add name="App.Properties.Settings.AppConnectionString" connectionString="Data Source=PRODUCTION;Initial Catalog=AppDB;User ID=ui;Password=mypassword" providerName="System.Data.SqlClient" /> </connectionStrings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="AppWebServiceSoap" maxReceivedMessageSize="2147483647"/> </basicHttpBinding> </bindings> <client> <!--<endpoint address="http://localhost:4550/AppWebService.asmx" binding="basicHttpBinding" bindingConfiguration="AppWebServiceSoap" contract="com.app.AppWebServiceSoap" name="AppWebServiceSoap" />--> <endpoint address="http://localhost/App/AppWebService.asmx" binding="basicHttpBinding" bindingConfiguration="AppWebServiceSoap" contract="com.app.AppWebServiceSoap" name="AppWebServiceSoap" /> </client> </system.serviceModel> </configuration>
这是web服务项目中的Web.Config:
<?xml version="1.0" encoding="utf-8"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" /> </system.web> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>
那么我该怎么做才能使我的应用程序能够运行并能够从域计算机访问IIS上的Web服务,以及能够在服务器上执行? (IISfunction和angular色都已启用)
本地主机就是这个本地主机。 它在服务器上testing时会起作用,因为服务器通过localhost连接到自己。 当从另一台机器testing它时,你需要通过服务器的IP地址或名称而不是本地主机来连接。 当使用本地主机时,每台机器都会尝试连接到自己,这当然是行不通的。