我知道如何在 Visual Studio 中提供服务引用。现在我要将代码部署到 IIS 服务器中。如何提供网络引用(即网络服务的网址。任何人都可以帮助我吗?
在系统 1 中(带有 Web 服务的 Web 应用程序)。系统 2(Web 应用程序、Web 服务必须从系统 1 获取)。我可以在 VS2008 中执行它,因为我可以轻松地为 system2 Web 应用程序提供服务引用..
最佳答案
部署时不需要再次添加引用,但您可能希望更改服务的地址、安全信息、配额、超时等。所有这些都是可配置的。
Web/服务引用信息存储在.Net 配置文件中(例如 app.config 和 web.config)。部署时,您可以根据需要更改这些值以指向正确的位置。
示例
注意address
属性。可以将其更改为您的端点所在的地址。
<system.serviceModel>
<client>
<endpoint
address="http://localhost/SampleServer/PersonService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_PersonService"
contract="People.PersonService" name="BasicHttpBinding_PersonService" />
</client>
</system.serviceModel>
关于asp.net - IIS 中的服务引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9752422/