Thanks Sameera.I have downloaded the rampart and understanding the samples. Interestingly in the basic one, there is a mention of DynamicConfiguration as item 11 but do not see any relevant examples.
Anyway will try out to have a better understand and get back to you if I have more questions. Best regards, cabear On Wed, Jan 28, 2009 at 11:31 AM, Sameera Jayasoma < [email protected]> wrote: > > > On Tue, Jan 27, 2009 at 1:55 AM, Wishing Carebear < > [email protected]> wrote: > >> Sameera: >> Looked into 240 link. It had the following information for client >> configurations: >> This configuration parameter should be included in the client's axis2.xml >> file and in sample-02 the file is >> "rampart-ut-samples/sample02/client.axis2.xml". >> >> My requirement is to do the WS-Security programmatically. Is it possible >> using rampart and axis2. > > > Yes, this should be possible. If you are using WS-SecurityPolicy to > indicate the security actions, anyway you need to specify that policy.xml > file. Please have a look at the Apache Rampart site for more details.. > > Following shows, how you should secure SOAP message using Rampart with > WS-SecurityPolicy. Rampart policy sample02 > > public static void main(String[] args) throws Exception { > > if(args.length != 3) { > System.out.println("Usage: $java Client endpoint_address > client_repo_path policy_xml_path"); > } > > ConfigurationContext ctx = > ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], > null); > > ServiceClient client = new ServiceClient(ctx, null); > Options options = new Options(); > options.setAction("urn:echo"); > options.setTo(new EndpointReference(args[0])); > options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, > loadPolicy(args[2])); > client.setOptions(options); > > client.engageModule("addressing"); > client.engageModule("rampart"); > > OMElement response = client.sendReceive(getPayload("Hello world")); > > System.out.println(response); > > } > > > > > >> >> Thanks for your time and help, >> cbear >> >> On Sun, Jan 25, 2009 at 6:32 AM, Sameera Jayasoma < >> [email protected]> wrote: >> >>> Hi, >>> >>> You can achieve WS-Security with Apache Axis2 by using Rampart. Rampart >>> is an Axis2 module. For more information please refer following articles. >>> >>> http://wso2.org/library/3190 >>> http://wso2.org/library/240 >>> >>> >>> >>> On Sat, Jan 24, 2009 at 8:15 AM, Wishing Carebear < >>> [email protected]> wrote: >>> >>>> Hello: >>>> I'm using the Cleint API's (ServiceClient and OperationClient) to >>>> consume webservices. I have been successful so far writing dynamic clients >>>> ( >>>> without using wsdl2java). >>>> >>>> Now want to integrate WSSecurity feature with the dynamic clients. >>>> >>>> Would like to know if there are any examples how to do WS_Security with >>>> Axis2. >>>> >>>> Thanks for your time and help >>>> cabear >>>> >>> >>> >>> >>> -- >>> Sameera Jayasoma >>> Software Engineer >>> WSO2 Inc. >>> Oxygenating the Web Service Platform. >>> http://wso2.org/ >>> >>> blog: http://tech.jayasoma.org >>> >> >> > > > -- > Sameera Jayasoma > Software Engineer > WSO2 Inc. > Oxygenating the Web Service Platform. > http://wso2.org/ > > blog: http://tech.jayasoma.org >
