tempuri.org命名空间调用Web服务 [英] tempuri.org namespace calling a webservice
问题描述
大家好,我有一个.net类,该类调用任何Web服务,并接收该Web服务的URL作为参数.我将这段代码用于命名空间,但我真的不知道它的作用:
_
我的问题是,如果打开Internet连接,代码会起作用,但是如果我将其关闭,它将不再起作用,可能是因为它无法访问http://tempuri.org来创建名称空间.
关于将调用该Web服务的计算机没有Internet连接,我该如何解决?
谢谢
Hi all, I have a .net class that invokes any webservice, and receives the URL of the webservice as a parameter. I use this piece of code for the namespace, but I don''t really know what it does:
_
My problem is that, if I have an internet connection ON, the code works, but if I turn it off, it no longer works, perhaps because it cannot reach http://tempuri.org to create the namespace.
How do I solve this, regarding that the computer that will call the webservice does not have a internet connection?
thank you
推荐答案
.net名称空间用于防止类之间的冲突.
In .net namespace are used to prevent collision between the classes.
namespace A {public class X {}}
namespace B {public class X {}}
尽管两者具有相同的类名称X,但它们是不同的.即一个是A.X,另一个是B.X
因此,如果您愿意,可以将名称空间更改为您选择的自定义站点,例如http://www.abc.com
Though both have the same class name X, they are different. ie one is A.X and other is B.X
So if you want you can change the namespace to a custom site of your choice like http://www.abc.com
这篇关于tempuri.org命名空间调用Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!