在Web服务问题中添加Web引用

时间:2009-10-18 06:42:53

标签: c# asp.net

我在本地系统中使用名称(收件箱服务)开发了一个Web服务。 当我确实添加了网络参考 我在我的Web服务descpition文件中得到了这样的结果

<?xml version="1.0" encoding="utf-8"?>
<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
  <contractRef ref="http://localhost:1518/popup-message/InboxService.asmx?wsdl" docRef="http://localhost:1518/popup-message/InboxService.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
  <soap address="http://localhost:1518/popup-message/InboxService.asmx" xmlns:q1="http://tempuri.org/" binding="q1:InboxServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
  <soap address="http://localhost:1518/popup-message/InboxService.asmx" xmlns:q2="http://tempuri.org/" binding="q2:InboxServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
</discovery>

但是当我在服务器上部署我的应用程序(项目)时。我的项目网址是这样的  例如:http://abc.com, 现在我的网络服务就像这样http://localhost:1518/popup-message/InboxService.asmx  如果我从我的页面绑定到调用方法,它不起作用是什么问题

任何帮助都会很棒。  谢谢

1 个答案:

答案 0 :(得分:2)

您是否在web.config / app.config中编辑了网址?请注意,如果Web引用位于dll(而不是Web层本身)中,您甚至可能看不到web.config中的设置;在这种情况下,将设置从VS中的dll配置复制到web.config中。请注意,dll配置并没有真正做任何事情,除了提供从中复制/粘贴该值的地方。