This week's book giveaway is in the
We're giving away four copies of
and have Sam Newman on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
wsse wss4j with axis client
Joined: Oct 12, 2006
Feb 01, 2007 07:03:00
I try to call a webservice with an axis client (wsdl2java).
With wss4j I add this Header:
<soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="0"> <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-31538695"> <wsse:Username>cmc_adm</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">scripting</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header>
But it does not work.
Here is a snippet of the response:
<soapenv:Fault><faultcode>soapenv:Server.generalException</faultcode> <faultstring>no such wsse:Security element
If I use another Header (see below) it works.
<soapenv:Header> <wsse:Security soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"> <wsse:UsernameToken> <wsse:Username xsi:type="xsd:string">cmc_adm</wsse:Username> <wsse:Password xsi:type="xsd:string">scripting</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header>
Can you please help me or give me a hint?
Joined: Feb 01, 2007
Feb 01, 2007 15:42:00
this may be the problem of the service side that is not recognizing the latest version of WSE. so when you used the older version(in the 2nd header you posted), it's working w/o problem.
Joined: Oct 12, 2006
Feb 02, 2007 00:39:00
Thanks. I'll check this.
I don't know what the problem is.
As a workaround i make a SOAPHeaderElement by hand. Without wss4j.
[ February 02, 2007: Message edited by: Christoph Maierhofer ]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: wsse wss4j with axis client
HeaderElements must be namespace qualified when create soap client
WSSecurity headers programmatically
how to implement ws-security in soap request header
Axis2 and mustUnderstand
Basic authentication soap header values?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015