I did a quick comparison of the generated code and found a few important
differences. No wonder it does not work.
No calls to attachPolicy in populateAxisService
No call to _service.applyPolicy(); in ctor
No generated function getPolicy
It looks like I should have a look towards my policy / wsdl2java. I took
the policy I use in 1.4.1, removed the sp:TransportBinding and left the
UsernameToken bits.
<wsp:Policy wsu:Id="UsernameTokenOverHTTPS" xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<wsp:ExactlyOne>
<wsp:All>
<sp:SupportingTokens xmlns:sp="
http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken="
http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient
"/>
</wsp:Policy>
</sp:SupportingTokens>
<ramp:RampartConfig xmlns:ramp="
http://ws.apache.org/rampart/policy">
<ramp:passwordCallbackClass>Service.SimpleUserPassCallback</ramp:passwordCallbackClass>
</ramp:RampartConfig>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
2012/4/2 Philippe A. <[email protected]>
> Sorry for the missing subject. I posted in a hurry.
>
> 2012/4/2 Philippe A. <[email protected]>
>
>> Hello,
>>
>> I have compiled Axis2 & rampart from trunk in order to workaround a bug
>> with wsdl2java. The client I developed back with Axis 1.4.1 no longer
>> works. More specifically, the username and password token does not get
>> added by the client in the soap header (confirmed with tcpdump). Client
>> requests are rejected by the server with "org.apache.axis2.AxisFault: SOAP
>> header missing".
>>
>> I also see the following in my server logs (not sure if it is related or
>> not):
>> [WARN] Deprecated usage of OMElement#declareNamespace(String,String) with
>> empty prefix
>>
>> My client is generated by wsdl2java and I wrote a simple wrapper class
>> around it. The wrapper closely matches this example:
>> http://blog.facilelogin.com/2008/11/security-policy-with-rampart.html
>>
>> I invoke wsdl2java with the following options: -s -uw.
>>
>> Debug traces show that rampart is being loaded by the client. I am not
>> using any other security for now (encryption or other). I am using
>> standalone axis server and I am in the process of replacing https transport
>> security for ws-security encryption.
>>
>> All ideas welcome. Thank you!
>>
>
>