c# - SOAP - namespace ,这是做什么用的?

标签 c# asp.net

SOAP 网络服务中使用的命名空间是什么?

最佳答案

来自 http://tempuri.org/ :

Each XML Web Service needs a unique namespace in order for client applications to distinguish it from other services on the Web. By default, ASP.Net Web Services use http://tempuri.org/ for this purpose. While this suitable for XML Web Services under development, published services should use a unique, permanent namespace.

Your XML Web Service should be identified by a namespace that you control. For example, you can use your company's Internet domain name as part of the namespace. Although many namespaces look like URLs, they need not point to actual resources on the Web.

假设公司 A 和 B 都使用相同签名的方法创建服务。为了区分它们,您可以添加命名空间。这将使它们与客户的角度不同,这意味着您不能从一个到另一个使用 wsdl(代理类),反之亦然。

为您的服务使用唯一的命名空间被认为是一种很好的做法。通常是您的公司名称/域名或类似名称,而不是默认的 tempuri.org

关于c# - SOAP - namespace ,这是做什么用的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3075453/

相关文章:

c# - 为什么这会导致 'Index out of range' 异常?

c# - 通过 linq 在列表中查找索引

c# - 设置一个方法来返回作为参数传递的函数的返回值

c# - 帮助异常处理

javascript 变量变量名和全局作用域 (pinesnotify)

asp.net - 在 css :hover as a background image 中请求时如何提供文件

c# - Linq-To-SQL 查询中的 String.Split?

c# - 调试时模拟丢失的对象

c# - Asp.Net MVC 5 应用程序中所有模型的 Models.ApplicationDbContext?

asp.net - 在 ASP.Net 中动态更改用户控件