A new approach to the secure interaction of components of distributed systems based on web services technology is considered. This approach implies the use of the Cryptographic Message Syntax (CMS) standard to protect data on the network by encapsulating HTTP requests to web services and HTTP responses in a Secure Message structure before transmission over the network. The paper shows that this approach is inferior in speed to traditional approaches based on VPN technology. However, it allows adding important additional functionality to the secure channel related to the demarcation of access rights to service functions and to the organization of parallel access to several similar web services.