return baos.toString();
}
public static String generateId(AxisDescription description) {
PolicyInclude policyInclude = description.getPolicyInclude();
String identifier = "-policy-1";
if (description instanceof AxisMessage) {
identifier = "msg-" + ((AxisMessage) description).getName()
+ identifier;
description = description.getParent();
}
if (description instanceof AxisOperation) {
identifier = "op-" + ((AxisOperation) description).getName()
+ identifier;
description = description.getParent();
}
if (description instanceof AxisService) {
identifier = "service-" + ((AxisService) description).getName()
+ identifier;
}
/*
* Int 49 is the value of the Character '1'. Here we want to change '1'
* to '2' or '2' to '3' .. etc. to construct a unique identifier.
*/
for (int index = 49; policyInclude.getPolicy(identifier) != null; index++) {
identifier = identifier.replace((char) index, (char) (index + 1));
}
return identifier;
}