This paper presents a new approach which addresses the issue of inconsistent message exchange during agent interactions. We advocate that in agent-based service-oriented computing systems, only agents should be in charge of executing interactions. We also require that the architecture of an agent be clearly separated in two distinct parts, a public and a private parts. The public part contains the interaction model, while any other data and process the agent needs belong to the private part. Our solution consists of automatically constructing the interaction model. It is based on a unification of the actions, required of an agent playing a role in a generic protocol, and the functionalities abstracted from the BPEL4WS model of this agent. We present the algorithms to perform this unification as well as the abstract models they manipulate.