In the latest svn there is a method to get the axis2_conf_ctx_t from the svc_client. You can also create the axis2_conf_ctx_t and then pass it to svc_client creation method.
Yes, you can use axis2_conf_is_engaged method. Supun. On Thu, Mar 12, 2009 at 11:09 AM, Raymond Zhou <[email protected]> wrote: > Hi Supun, > > Can you please point me to how I could get axis2_conf_ctx from svc_client? > It doesn't seem possible. > > I find out another way though, from axis2_conf.h, you have the following > interface: > > AXIS2_EXTERN axis2_conf_t *AXIS2_CALL axis2_conf_create( > const axutil_env_t * env); > So you can create one axis2_conf_t, then in this same inferface, you have: > > AXIS2_EXTERN axis2_bool_t AXIS2_CALL axis2_conf_is_engaged(axis2_conf_t * > conf, > const axutil_env_t * env, const axutil_qname_t * module_name); > You can now figure out if rampart is engaged, is this a right approach? The > drawback is that If service client already create one axis2_conf_t, this way > create the same structure twice. > > Thanks! > Ray > > > --- On *Tue, 3/10/09, Supun Kamburugamuva <[email protected]>* wrote: > > > From: Supun Kamburugamuva <[email protected]> > Subject: Re: How do I know ws-security is enabled programmatically? > To: "Apache AXIS C User List" <[email protected]> > Date: Tuesday, March 10, 2009, 4:01 AM > > When you create the svc_client you create the axis2_conf_ctx. This holds > all the axis2 configurations. You can access the axis2_conf_ctx from > svc_client and you can access the axis2_conf_t from axis2_conf_ctx_t. > axis2_conf_t contains the list of all the engaged modules. > > Have a look at conf.c file. > > Supun. > > On Tue, Mar 10, 2009 at 8:41 AM, Raymond Zhou > <[email protected]<http://us.mc464.mail.yahoo.com/mc/[email protected]> > > wrote: > >> Hi Manjula, >> >> Maybe my writing is a bit confusing, my question is not really about >> setting the policy file programmatically, my question is about how I know >> the ws-security is enabled programmatically (which means that the rampart/c >> module is engaged in axis2/c configuration file). I need to know this >> because my client code need to support both ws-security enabled and >> ws-security disabled (the normal case), so that in the case of no >> ws-security I don't have to read the policy file and set any ws-securit >> related parameters programmatically. >> >> Thanks! >> Ray >> >> --- On *Tue, 3/10/09, Manjula Peiris >> <[email protected]<http://us.mc464.mail.yahoo.com/mc/[email protected]> >> >* wrote: >> >> >> From: Manjula Peiris >> <[email protected]<http://us.mc464.mail.yahoo.com/mc/[email protected]> >> > >> Subject: Re: How do I know ws-security is enabled programmatically? >> To: "Apache AXIS C User List" >> <[email protected]<http://us.mc464.mail.yahoo.com/mc/[email protected]> >> > >> Date: Tuesday, March 10, 2009, 3:12 AM >> >> >> when you engage rampart there should be a policy to construct the >> message. Please see Rampart/c samples for more info. >> >> On Mon, 2009-03-09 at 00:20 -0700, Raymond Zhou wrote: >> > >> > A quick question. I am using rampart/c to provide ws-security for a >> > web service client application. How do I know ws-security is enabled >> > programmatically? I understand that in order to use ws-security I need >> > to do something in the configuration file axis2.xml and I also need to >> > put rampart/c as a module. But I also need to set the security policy >> > into the web service client object programmatically, right? Then I >> > need to know whether or not ws-security is enabled, and if not, I >> > don't need to set the policy (there is none actually) into the ws >> > client object. >> > >> > Thanks! >> > Ray >> > >> >> >> > > > -- > Software Engineer, WSO2 Inc > http://wso2.org > supunk.blogspot.com > > > > -- Software Engineer, WSO2 Inc http://wso2.org supunk.blogspot.com
