0

I create a project in SoapUi from a WSDL where the request must have ws-addressing and ws-security.

The question is where I have to configure SoapUI to add ws-security and ws-addressing so the generator takes that values and include in the Java clasess that creates.

I did it first on the request soap message, but generator didnt use it. Then I added to the Outgoing WS-Security Configurations, but the same result. The clases are the same as if I never set that conf.

What I m missing?

4

1 回答 1

1

[编辑]

wsimport 必须已生成名称后缀为“_Service”的服务端口类。

YourServiceName_Service svcPort;

// ....

Map<String, Object> request = ((BindingProvider) svcPort).getRequestContext();
request.put(BindingProvider.USERNAME_PROPERTY, "<username>");
request.put(BindingProvider.PASSWORD_PROPERTY, "<password>");

您必须在自动生成类的基类上设置 ws-security 凭据。这个例子可以帮助你

http://java.globinch.com/enterprise-java/web-services/jax-ws/secure-usernametoken-java-web-services-using-metro-wsit/#jax-ws-usernametoken-client-example

于 2014-09-17T15:30:19.907 回答