You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Brecht Yperman <Br...@invenso.com> on 2006/08/10 09:17:11 UTC
[Axis2] Configure Rampart dynamically
Hi,
how do I configure Rampart dynamically?
I tried something like this, but it does not work...
private void configureSecurity(ServiceClient client) throws AxisFault {
if (true /*security == on*/) {
Parameter parm = new Parameter();
parm.setName("OutflowSecurity");
OMFactory fact = OMAbstractFactory.getOMFactory();
OMNamespace emptyNS = fact.createOMNamespace(null,
"");
OMElement actionEl = fact.createOMElement("action",
emptyNS);
OMElement itemsEl = fact.createOMElement("items",
emptyNS);
itemsEl.setText("UsernameToken");
actionEl.addChild(itemsEl);
OMElement userEl = fact.createOMElement("user",
emptyNS);
userEl.setText("bob");
actionEl.addChild(userEl);
OMElement pwCbEl =
fact.createOMElement("passwordCallbackClass", emptyNS);
pwCbEl.setText("CallbackHandler");
actionEl.addChild(pwCbEl);
parm.setParameterElement(actionEl);
client.engageModule(new QName("rampart-1.0"));
}
}
Thanks,
Brecht
Invenso - The "Integration Software" specialists.
_____________________________________________
Brecht Yperman
Development team
Direct: +32 (0)3 780 30 05
Email: brecht.yperman@invenso.com
INVENSO bvba
Industriepark-West 75
9100 Sint-Niklaas
Belgium - Europe
Phone: +32 (0)3 780 30 02
Fax: +32 (0)3 780 30 03
Email: info@invenso.com
Website: www.invenso.com <http://www.invenso.com/>
"E-mail disclaimer: This e-mail, and any attachments thereto, is
intended only for use by the addressee(s) named herein and may contain
legally privileged and/or confidential information. If you are not the
intended recipient, please note that any review, dissemination,
disclosure, alteration, printing, copying or transmission of this e-mail
and/or any file transmitted with it, is strictly prohibited and may be
unlawful. If you have received this e-mail by mistake, please
immediately notify the sender and permanently delete the original as
well as any copy of any e-mail and any printout thereof."
Re: [Axis2] Configure Rampart dynamically
Posted by Ruchith Fernando <ru...@gmail.com>.
Hi Brecht,
Yes it is possible. Please see here:
http://marc.theaimsgroup.com/?l=axis-user&m=115517624610919&w=2
Thanks,
Ruchith
On 8/10/06, Brecht Yperman <Br...@invenso.com> wrote:
>
>
>
>
> Hi,
>
>
>
> how do I configure Rampart dynamically?
>
>
>
> I tried something like this, but it does not work...
>
>
>
> private void configureSecurity(ServiceClient client) throws AxisFault {
>
> if (true /*security == on*/) {
>
> Parameter parm = new Parameter();
>
> parm.setName("OutflowSecurity");
>
>
>
> OMFactory fact = OMAbstractFactory.getOMFactory();
>
>
>
> OMNamespace emptyNS = fact.createOMNamespace(null, "");
>
> OMElement actionEl = fact.createOMElement("action",
> emptyNS);
>
>
>
> OMElement itemsEl = fact.createOMElement("items",
> emptyNS);
>
> itemsEl.setText("UsernameToken");
>
> actionEl.addChild(itemsEl);
>
>
>
> OMElement userEl = fact.createOMElement("user", emptyNS);
>
> userEl.setText("bob");
>
> actionEl.addChild(userEl);
>
>
>
> OMElement pwCbEl =
> fact.createOMElement("passwordCallbackClass", emptyNS);
>
> pwCbEl.setText("CallbackHandler");
>
> actionEl.addChild(pwCbEl);
>
>
>
> parm.setParameterElement(actionEl);
>
>
>
> client.engageModule(new QName("rampart-1.0"));
>
> }
>
> }
>
>
>
> Thanks,
>
> Brecht
>
>
>
> Invenso - The "Integration Software" specialists.
> _____________________________________________
>
> Brecht Yperman
> Development team
>
> Direct: +32 (0)3 780 30 05
> Email: brecht.yperman@invenso.com
>
> INVENSO bvba
> Industriepark-West 75
> 9100 Sint-Niklaas
> Belgium - Europe
>
> Phone: +32 (0)3 780 30 02
> Fax: +32 (0)3 780 30 03
> Email: info@invenso.com
> Website: www.invenso.com
>
> "E-mail disclaimer: This e-mail, and any attachments thereto, is intended
> only for use by the addressee(s) named herein and may contain legally
> privileged and/or confidential information. If you are not the intended
> recipient, please note that any review, dissemination, disclosure,
> alteration, printing, copying or transmission of this e-mail and/or any file
> transmitted with it, is strictly prohibited and may be unlawful. If you have
> received this e-mail by mistake, please immediately notify the sender and
> permanently delete the original as well as any copy of any e-mail and any
> printout thereof."
>
>
--
www.ruchith.org
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org