*
*Hi
I tried that way kishanthan, but couldn't do it , it gives same thing..
*
RampartConfig rampartConfig = new RampartConfig();
rampartConfig.setTimestampTTL("300");
rampartConfig.setUser("admin");
rampartConfig.setPwCbClass("org.wso2.carbon.appfactory.application.mgt.service.PWCBHandler");
ServiceClient client = new ServiceClient(
ServiceReferenceHolder.getInstance().getConfigContextService().getClientConfigContext(),
null);
client.getOptions().setTo(new
EndpointReference(EPR));
client.engageModule("rampart");
client.engageModule("addressing");
String configs =
CarbonUtils.getCarbonConfigDirPath();
Policy policy = loadPolicy(configs +
"/appfactory/bpel-policy.xml");
policy.addAssertion(rampartConfig);
client.getOptions().setProperty(RampartMessageData.KEY_RAMPART_POLICY,
policy);
client.sendRobust(getPayload(applicationInfoBean));
*
thanks
harsha
On Thu, Jan 17, 2013 at 11:19 AM, Kishanthan Thangarajah <
[email protected]> wrote:
> You have build rampart config [1] before invoking, which will solve this
> issue.
>
> Thanks,
> Kishanthan.
> [1] http://blog.thilinamb.com/2009/12/how-to-build-rampart-config.html
>
> On Thu, Jan 17, 2013 at 9:57 AM, Harsha Thirimanna <[email protected]>wrote:
>
>> Hi ,
>> I am going to call BPEL Service from Java that using Rampart policy.
>>
>> This is how I did that.
>>
>> *final String EPR =
>> configuration.getFirstProperty(AppFactoryConstants.BPS_SERVER_URL) +
>> "ApplicationCreation";
>>
>> try {
>>
>> ServiceClient client = new ServiceClient(
>> ServiceReferenceHolder.getInstance().getConfigContextService().getClientConfigContext(),
>> null);
>>
>> // Set the endpoint address
>> client.getOptions().setTo(new
>> EndpointReference(EPR));
>> client.engageModule("rampart");
>> client.engageModule("addressing");
>> String userName =
>> configuration.getFirstProperty(AppFactoryConstants.SERVER_ADMIN_NAME);
>> String password =
>> configuration.getFirstProperty(AppFactoryConstants.SERVER_ADMIN_PASSWORD);
>> client.getOptions().setUserName(userName);
>> client.getOptions().setPassword(password);
>>
>>
>> String configs =
>> CarbonUtils.getCarbonConfigDirPath();
>>
>> client.getOptions().setProperty(RampartMessageData.KEY_RAMPART_POLICY,
>> loadPolicy(configs + "/appfactory/bpel-policy.xml"));
>>
>>
>> client.sendRobust(getPayload(applicationInfoBean));
>>
>>
>>
>> } catch (Exception e) {
>> log.error(e);
>> }*
>>
>>
>> but thing is that , it says
>>
>> *org.apache.axis2.AxisFault: Missing wsse:Security header in request*
>>
>>
>> thanks
>> Harsha Thirimanna
>>
>>
>>
>>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Kishanthan Thangarajah*
> Software Engineer,
> Development Technologies Team,
> WSO2, Inc.
> lean.enterprise.middleware
>
> Mobile - +94773426635
> Blog - *http://kishanthan.wordpress.com*
> Twitter - *http://twitter.com/kishanthan*
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev