首页 \ 问答 \ 为什么常见的Web服务客户端使用代理(Why do common web services client use a proxy)

为什么常见的Web服务客户端使用代理(Why do common web services client use a proxy)

我注意到大多数充当Web服务客户端的架构使用代理与其余服务器通信? 虽然可以在没有代理服务器的情况下访问休息服务,但我读过的一个例子就是它使用代理服务器与其服务器进行通信是否有使用代理访问休息服务的优势?


I've noticed that most architectures that acts as a web service client uses a proxy to communicate with the rest server? While it is possible to access a rest service without a proxy server, one example I've read is this where it uses a proxy server to communicate with its rest server are there any advantages of using a proxy to access a rest service?


原文:https://stackoverflow.com/questions/20757390
更新时间:2024-01-17 13:01

最满意答案

我认为你已经把它放在了Constructor之前。 在Constructor函数外部使用的任何对象初始值设定项都必须引用静态成员。 您收到此错误是因为必须先初始化实例,然后才能访问其类的属性。 您应该将代码放在Constructor


I think you have placed it before the Constructor. Any object initializer used outside a Constructor has to refer to static members. You got this error because the instance has to be initialized before you can access the properties of its class. You should place your code inside the Constructor.

相关问答

更多
  • 你可以这样做 - int[] terms = new int[400]; for (int runs = 0; runs < 400; runs++) { terms[runs] = value; } 或者,您可以使用列表 - 列表的优点,在实例化列表时不需要知道数组大小。 List termsList = new List(); for (int runs = 0; runs < 400; runs++) { termsList.Add(value); } // Y ...
  • 问题很可能不在此方法中,而是在调用方法中使用方法执行的结果。 我想,你以后会尝试Console.WriteLine这样的数组内容: string[] result = majorScaleOfNote("M1"); Console.WriteLine(result); 你不能以这种方式输出数组。 C#将.ToString()应用于所有对象以获取其字符串表示形式。 数组没有自己的ToString()方法,这会导致调用大多数基类Object的.ToString() 。 它只是做以下事情: public vi ...
  • 使用System.Collections.Generic.List而不是Gun[] 它使您能够在特定位置插入。 List availableGuns; ... availableGuns = new List(); availableGuns.Insert(gun[i], i); 如果你想继续使用数组: for (int i = 0; i < guns.Length; i++) { if ((GameDataManager.publicInstance.gun ...
  • 如果您正在使用linq,请尝试以下方法: String[] mylist = list.Select(I => Convert.ToString(I.ip)).ToArray(); If you are using linq try this instead : String[] mylist = list.Select(I => Convert.ToString(I.ip)).ToArray();
  • 一个数组是string[] ,而不是List ,所以只需要这样做: Dictionary wordDictionary = new Dictionary(); 现在,您可以照常添加阵列。 wordDictionary.Add("IN", IN); 要么: wordDictionary.Add("IN", new string[] {"Against","Like","Upon","Through","Of","Wit ...
  • 我认为你需要为你的场景使用List ,因为Array是用一个尺寸声明的,我们必须跟踪添加移除元素以知道其中有多少元素以及哪些插槽具有价值或不是,以便我们可以在最后一个可用索引处添加新项目。 对于我们事先不知道要进入的元素数量的情况, List是一个更好的选择,如果你使用它,那么你只需要在你的实例上调用Add()方法来添加新的项目在里面。 在这种情况下你的代码就像: public List spells; 这将保存UISpellInfo类型的所有项目,并且现在放在代码中 ...
  • 我认为你已经把它放在了Constructor之前。 在Constructor函数外部使用的任何对象初始值设定项都必须引用静态成员。 您收到此错误是因为必须先初始化实例,然后才能访问其类的属性。 您应该将代码放在Constructor 。 I think you have placed it before the Constructor. Any object initializer used outside a Constructor has to refer to static members. You ...
  • 好的,首先你有一个string ,你想把它分配给byte[]这是一个很大的nono。 如果您不能手动将其更改为byte[] (因为某些奇怪的协议或其他东西),您可以这样做: // assign bytes to string string meBytes = "00 00 00 00 00 00 00 00 04 05 01 01 01 01 01 01 04 05 01 01 01 01 01 01 04 05 01 01 01 01 01 01 04 05 01 01 01 01 01 01 04 05 ...
  • var url - communityHeader.LeftLogo.MediaUrl; LeftLogo2.Attributes["src"]=url; 你真的在运行那个确切的代码吗? 请注意,您只有一个' - '而不是'='。 您应该能够以这种方式访问src属性。 var url - communityHeader.LeftLogo.MediaUrl; LeftLogo2.Attributes["src"]=url; Are you actually running that exact code? ...
  • 我认为问题是您使用的是BsonDocument类型的集合,但您的过滤器和更新定义属于PostInfo类型。 如果您将集合访问者更改为此功能,它是否有效? var collection = mongoDbServer.GetCollection("post"); 否则,您的更新代码对我来说是正确的。 I think the problem is that you're using a collection of type BsonDocument but your filter and ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)