调用weblogic部署的OASIS WSSE web服务

发布于 2024-12-03 11:58:35 字数 1644 浏览 2 评论 0 原文

我们在实现 oasis wsse 的 weblogic 上部署了 webservice。然后我使用 jboss 中的 wsconsume 创建客户端(后来尝试了 Metro)并调用 Web 服务。总是抛出错误,我尝试在soapUI中创建一个测试客户端发送成功,发现jboss产生的请求不匹配。

我发现有两个区别: 1.) 日期令牌: 在职的:

2011-09-06T08:22:14.515Z

不工作:

2011-09-07T06:12:37.322Z

2.) 密码类型: 在职的:

OB7izBPcPE0sfJaAEdD1uIrlFT4=< ;/wsse:密码>

不工作:

trvFhf0ZCHQy4cBtNu984fs/nIg =

这就是我从客户端调用 Web 服务的方式:

URL clientSideSecurityfile = new File("jboss-wsse-client.xml").toURI().toURL();
BindingProvider bp = (BindingProvider) port;
((StubExt) port).setSecurityConfig(clientSideSecurityfile.toExternalForm());
((StubExt) port).setConfigName("Standard WSSecurity Client");
bp.getRequestContext().put(StubExt.PROPERTY_AUTH_TYPE, StubExt.PROPERTY_AUTH_TYPE_BASIC);
bp.getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, 30000); 
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "usernmae");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password");
responseACK = port.callWebService();

我使用的是 jboss4.2.3、jbossws-client 3.0.1-native-2.0.4.GA。

知道如何解决这个问题吗?看来 jbossws 正在生成错误的 wsse 标签,该标签应该是 wsu 作为 datetoken 并输入密码:-?。

We have webservice deployed on weblogic that implements oasis wsse. Then I created the client using wsconsume from jboss (later tried metro) and called the web service. It always throws an error, I tried to create a test client in soapUI that is sent successfully and found out that the request produced by jboss doesn't match.

There are 2 difference that I've found:
1.) DateToken:
Working:

<wsu:Created>2011-09-06T08:22:14.515Z</wsu:Created>

Not working:

<wsse:Created>2011-09-07T06:12:37.322Z</wsse:Created>

2.) Password Type:
Working:

<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">OB7izBPcPE0sfJaAEdD1uIrlFT4=</wsse:Password>

Not working:

<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordDigest'>trvFhf0ZCHQy4cBtNu984fs/nIg=</wsse:Password>

This is how I call the web service from client:

URL clientSideSecurityfile = new File("jboss-wsse-client.xml").toURI().toURL();
BindingProvider bp = (BindingProvider) port;
((StubExt) port).setSecurityConfig(clientSideSecurityfile.toExternalForm());
((StubExt) port).setConfigName("Standard WSSecurity Client");
bp.getRequestContext().put(StubExt.PROPERTY_AUTH_TYPE, StubExt.PROPERTY_AUTH_TYPE_BASIC);
bp.getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, 30000); 
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "usernmae");
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password");
responseACK = port.callWebService();

I'm using jboss4.2.3, jbossws-client 3.0.1-native-2.0.4.GA.

Any idea how to resolve this? It seems jbossws is producing wrong wsse tag which should be wsu for datetoken and type for password :-?.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我不在是我 2024-12-10 11:58:35

根据 UsernameToken 配置文件规范< /a> 应该是,

<wsu:Created>

其中

wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-
1.0.xsd"

此外,根据规范类型应该是,

Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"

两者;

<wsse:Created>2011-09-07T06:12:37.322Z</wsse:Created>

并且

<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordDigest'>trvFhf0ZCHQy4cBtNu984fs/nIg=</wsse:Password>

不符合规范...

According to the UsernameToken profile specification it should be,

<wsu:Created>

Where

wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-
1.0.xsd"

Also, as per the specification type should be,

Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"

Both;

<wsse:Created>2011-09-07T06:12:37.322Z</wsse:Created>

And

<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordDigest'>trvFhf0ZCHQy4cBtNu984fs/nIg=</wsse:Password>

are, not compliant with the specification...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文