Attachment of the end-piece to the flexible member