// Find the <service-ref> entry this handler chain belongs to and insert it
ServiceRefType[] serviceRefs = annotatedApp.getServiceRefArray();
boolean exists = false;
for ( ServiceRefType serviceRef : serviceRefs ) {
if ( serviceRef.getServiceRefName().getStringValue().trim().equals(serviceRefName) ) {
ServiceRefHandlerChainsType serviceRefHandlerChains = serviceRef.addNewHandlerChains();
for (HandlerChainType handlerChain : handlerChains.getHandlerChainArray()) {
ServiceRefHandlerChainType serviceRefHandlerChain = serviceRefHandlerChains.addNewHandlerChain();
for ( PortComponentHandlerType handler : handlerChain.getHandlerArray()) {
ServiceRefHandlerType serviceRefHandler = serviceRefHandlerChain.addNewHandler();
serviceRefHandler.setHandlerName(handler.getHandlerName());
serviceRefHandler.setHandlerClass(handler.getHandlerClass());
if (handler.getDescriptionArray().length>0) {