[英]JAX-WS port from WSDL
I have a JAX-WS imported WSDL client. 我有一个JAX-WS导入的WSDL客户端。 When I try to connect to webservice endpoint, the JAX-WS client tries to load WSDL.
当我尝试连接到webservice端点时,JAX-WS客户端尝试加载WSDL。 Why that?
为什么?
Questions : 问题 :
Adding port with the same QName and port name fails, because I cant add the same. 添加具有相同QName和端口名称的端口失败,因为我无法添加相同的内容。 Adding a different port is OK, but I cant get it from the webservice delegate, because the WSDL does not contains the added port definition.
添加一个不同的端口是可以的,但是我无法从webservice委托中获取它,因为WSDL不包含添加的端口定义。
JAX-WS seem to be completely wrong way :( JAX-WS似乎是完全错误的方式:(
Today you're in luck. 今天你很幸运。 There is a way, as you've mentioned.
正如你所提到的,有一种方法。
QName qname = new QName("http://thenamespace", "FooService");
FooService service = new FooService(null, qname); // null for ignore WSDL file
Foo port = service.getFooPort();
BindingProvider bindingProvider = (BindingProvider) port;
bindingProvider.getRequestContext()
.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://foo.com/soap/fooBean");
// Use the service
Object obj = port.doSomething(param);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.