简体   繁体   English

如何将单例类的Web服务用于不同的URL

[英]How to use web services from the singleton class for the different url

iam developing an app, in which i have to call many webservices. 我要开发一个应用程序,在其中我必须调用许多Web服务。 So, can we place all web services in a singleton class method. 因此,我们可以将所有Web服务放置在单例类方法中吗? and access those method every were in the class is this possible. 并可以访问类中每个人的方法。 please help we out. 请帮助我们。

You can have a method with parameter 'queryType'. 您可以使用带有参数“ queryType”的方法。 Place all the web services in that method and place a check to call the service on the 'queryType'. 将所有Web服务放在该方法中,然后在“ queryType”上打勾以调用该服务。 The checks can be a 'if' or 'switch'. 支票可以是“ if”或“ switch”。 For this you need to work around for the logic. 为此,您需要解决逻辑问题。 Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM