Thanks Paul
I'll try to do it in this way...
Paul Fremantle wrote:
Mikhail
Yes I have experience of doing this. The latest Axis2 1.2 release will
embed the policy into the code-generated stub and attempt to engage
Rampart with that policy.
Alternatively you can explicitly set the policy using:
StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
Policy policy = PolicyEngine.getPolicy(builder.getDocumentElement());
stub._getServiceClient().getOptions().setProperty(RampartMessageData.KEY_RAMPART_POLICY,
policy);
In general you also need to configure Rampart with information like
passwords etc.
You do this using another policy file like this:
<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
<ramp:timestampTTL>303</ramp:timestampTTL>
<ramp:encryptionUser>me</ramp:encryptionUser>
<ramp:passwordCallbackClass>PWCallback</ramp:passwordCallbackClass>
,,,
</ramp:RampartConfig>
You can merge the two policies first - so:
StAXOMBuilder builder = new StAXOMBuilder(dotnetPolicy);
Policy dotnetPolicy =
PolicyEngine.getPolicy(builder.getDocumentElement());
StAXOMBuilder builder2 = new StAXOMBuilder(rampartPolicy);
Policy rampartPolicy =
PolicyEngine.getPolicy(builder.getDocumentElement());
Policy policy = dotnetPolicy.merge(rampartPolicy);
And then set it onto the stub or service client as above.
Paul
--
WBR,
Mikhail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]