java中的通用Web服务客户端(Generic Web Service client in java)
我在文本文件中有WSDL URL列表。 我必须在我的java程序中调用所有这些wsdl。 每个wsdl只有一个opertaion。 我尝试在netbeans中创建webservice客户端,但它只用于一个wsdl url。 我想拥有通用客户端。 请建议一些API(jar)和简单的教程来做到这一点。
I have list of WSDL urls in a text file. I have to invoke all of these wsdl in my java program. Each wsdl has only one opertaion. I tried to create webservice client in netbeans but it is for only one wsdl url. I want to have generic client. Kindly suggest some API(jar) and easy tutorial for doing this.
原文:https://stackoverflow.com/questions/22222229
更新时间:2023-02-25 13:02
最满意答案
我认为你可以像这样做一个
UIImageView
的扩展:extension UIImageView { convenience init(_imageName: String = "", _frameTulpe: (x: CGFloat, y: CGFloat, w: CGFloat, h: CGFloat) = (0, 0, 0, 0), _tag: Int = 0, _isUserInteractionEnabled: Bool = true, _backgroundColor: UIColor = UIColor.lightGray) { self.init(image: UIImage(named: _imageName)) frame = CGRect(x: _frameTulpe.x, y: _frameTulpe.y, width: _frameTulpe.w, height: _frameTulpe.h) tag = _tag isUserInteractionEnabled = _isUserInteractionEnabled backgroundColor = _backgroundColor } }
然后,在你的
TopView.swift
中将是:class TopView: UIView { var aview: aImageView! var bview: bImageView! init(frame: CGRect, stage:Int){ super.init(frame: frame) aview = UIImageView(_imageName: "item_a01_70x50", _frameTulpe:(0, 0, 70, 50), _tag: 100) self.addSubview(aview) bview = UIImageView(_imageName: "item_b02_70x50", _frameTulpe:(100, 100, 70, 50), _tag: 200) self.addSubview(bview) //...and sometimes delete them, create them again other time, and create... } }
i think you can make an extension of
UIImageView
like this:extension UIImageView { convenience init(_imageName: String = "", _frameTulpe: (x: CGFloat, y: CGFloat, w: CGFloat, h: CGFloat) = (0, 0, 0, 0), _tag: Int = 0, _isUserInteractionEnabled: Bool = true, _backgroundColor: UIColor = UIColor.lightGray) { self.init(image: UIImage(named: _imageName)) frame = CGRect(x: _frameTulpe.x, y: _frameTulpe.y, width: _frameTulpe.w, height: _frameTulpe.h) tag = _tag isUserInteractionEnabled = _isUserInteractionEnabled backgroundColor = _backgroundColor } }
And then, in your
TopView.swift
will be:class TopView: UIView { var aview: aImageView! var bview: bImageView! init(frame: CGRect, stage:Int){ super.init(frame: frame) aview = UIImageView(_imageName: "item_a01_70x50", _frameTulpe:(0, 0, 70, 50), _tag: 100) self.addSubview(aview) bview = UIImageView(_imageName: "item_b02_70x50", _frameTulpe:(100, 100, 70, 50), _tag: 200) self.addSubview(bview) //...and sometimes delete them, create them again other time, and create... } }
相关问答
更多-
override func viewDidLoad() { super.viewDidLoad() var label = UILabel(frame: CGRectMake(0, 0, 200, 21)) label.center = CGPointMake(160, 284) label.textAlignment = NSTextAlignment.Center label.text = "I'am a test label" self.view.addSubview(labe ...
-
这是从右到左滚动显示的一种方法。 创建一个自定义视图,可以使用drawRect函数绘制5x8单元格。 使用其中11个视图来表示您的显示。 将它们作为子视图添加到适当大小的视图中。 每隔1/25秒,移动11个视图,如果最左边的一个已经滚动到最后,将其移动到右侧并用新的字母数据更新它。 Here is one approach for a right-to-left scrolling display. Create a custom view that can draw a 5x8 cell with its ...
-
创建并发队列 let concurrentQueue = DispatchQueue(label: "queuename", attributes: .concurrent) concurrentQueue.sync { } 创建串行队列 let serialQueue = DispatchQueue(label: "queuename") serialQueue.sync { } 异步获取主队列 DispatchQueue.main.async { } 同步获取主队列 DispatchQ ...
-
在swift中以编程方式在两个视图之间添加垂直间距(Adding Vertical Spacing between two views programmatically in swift)[2023-06-20]
您提供的代码是99%正确但 self.view.addConstraint( NSLayoutConstraint( item: secondView, attribute: .Top, relatedBy: .Equal, toItem: firstView, attribute: .Top, multiplier: 1.0, constant: 0 )) 您将secondVi ... -
以下是使用UIStackViews构建键盘的代码片段... func newPad() { keyPadWindow = UIView(frame: CGRect(x: 128, y: 224, width: 512, height: 356)) keyPadWindow.backgroundColor = UIColor.yellowColor() var keyCount = 0 keyPadSV = UIStackView(frame: CGRect(x: 0, y: ...
-
无需使用swift即可创建和转换视图(Creating and transitioning views without using storyboard with swift)[2020-01-16]
在使用Storyboards和.XIB文件或在纯代码中执行所有UIKit方面没有什么不同。 在这方面,Swift和Obj-C可以访问相同的IDE工具,因此您可能正在寻找不存在的问题。 好像你只是在问如何根据现有的Obj-C代码编写Swift语法。 “使用Swift的程序化视图控制器示例”应该可以通过更多努力进行转换,但对于您的代码: import UIKit class SecondViewController: UIViewController { } class FirstViewControlle ... -
我认为你可以像这样做一个UIImageView的扩展: extension UIImageView { convenience init(_imageName: String = "", _frameTulpe: (x: CGFloat, y: CGFloat, w: CGFloat, h: CGFloat) = (0, 0, 0, 0), _tag: Int = 0, _isUserIn ...
-
虽然这个问题的任何答案最终都是在MVP设计模式中得出的,但视图不应该包含任何业务逻辑,只需要显示逻辑。 这意味着它不应该知道它的东道主。 我接近它的方法是在其主机中编写连接代码和交互代码。 class MyNavigationView : UIView { var button : UIButton! } class ViewController : UIViewController { override func viewDidLoad() { super.vie ...
-
您收到此错误是因为srchBar变量被声明为weak 。 由于weak变量不会增加保留计数,因此在将其添加为子视图之前会将其取消分配。 就像是 let searchBar = UISearchBar() view.addSubview(searchBar) self.srchBar = searchBar 应该避免崩溃。 You're getting this error because the srchBar variable is declared as weak. Since weak variab ...
-
这解释了如何使用storyboard创建分页视图控制器: 将UIPageViewController拖到故事板中并将其标记为初始视图控制器。 然后创建一个新的UIPageViewController子类 - 比如称之为TutorialPageViewController并将其分配给刚刚拖入storyboard的对象。 现在将两个新的UIViewController拖入storyboard并为每个创建/分配一个子类,就像你通常那样。 为这两个视图控制器中的每一个提供一个Storyboard ID例如RedVi ...