Communication Between Applications

In Application Designer, you can configure communication pathways between applications by connecting them through their endpoints. On the application diagram, connections are based on the configuration of consumer endpoints and represent how applications are connected in the development environment, not necessarily the deployment environment. For implemented applications and supported types of connections, connections create configuration settings in the application configuration file. Changing connections on the application diagram changes these configuration settings and vice versa. Basing connections on configuration file entries ensures that addresses for provider endpoints are not hardcoded into the consumer application, making it possible to reconfigure connections at deployment.

Tip

Connections on the application diagram represent those that are followed if you were to debug your solution using the Visual Studio Debugger. For more information, see Debugging in Visual Studio.

For example, connecting a Web service provider endpoint on an ASP.NET application to another application on the application diagram creates a Web service consumer endpoint on the consumer application. This consumer endpoint is configured with the address of the Web provider endpoint.

By comparison, connections on a system diagram created using System Designer describe how to connect applications when an instance of the system is deployed. On a system diagram, connections are instructions to configure consumer endpoints with the addresses of provider endpoints, such as Web service URLs, when the applications are deployed.

For more information, see the following topics:

Configuring Communication Pathways on Application Diagrams

On the application diagram, you can configure communication pathways between applications by connecting application definitions through their endpoints. You can add or create application endpoints as needed. Connections lines appear on the diagram with arrows, indicating the direction of communication from consumer endpoint to provider endpoint.

By default, a consumer endpoint on application requires a connection to a suitable provider endpoint for the application to function correctly. On the application diagram, the definition of a consumer endpoint has a Connection Required application endpoint setting, which is set to True and is not overridable by default when you include a use of an application with that endpoint in a system. However, if the application's implementation permits the connection to be optional, you can change this setting to False on the endpoint definition or override the setting when including the endpoint within the context of a system. Otherwise, the consumer endpoint must be connected or delegated within any system that includes the associated application.

Note

If a Web service consumer endpoint is disconnected when a connection is required, a validation error will result when evaluating deployment for a system containing the associated application. The only time a connection should not be required is when the application has been implemented so that it can be deployed and used without configuration information, which is not the typical case. For more information, see Validating Deployment Diagrams.

For more information, see the following topics:

The following sections contain more information about connections on the application diagram:

  • Connections to Web Services

  • Connections to External Databases

  • Deleting or Moving Connections

Connections to Web Services

Connecting applications to the same Web service provider endpoint during application and system design specifies that its consumer applications will be configured with a common Web service URL at deployment. The same Web service URLs used in development might be also used at deployment. However, you can override them when you include uses of Web service consumer applications in a system, or you can replace them altogether at deployment. When you evaluate deployment for a system, the deployment report that you generate provides information about how to propagate URLs between Web service providers and consumers.

Distributed System Designers support application types that communicate using SOAP messages. SOAP is a lightweight protocol that uses an extensible XML-based messaging framework to exchange structured information in a distributed environment. A Web service might also support additional protocols, for example, HTTP-POST or HTTP-GET. However, the application diagram displays only SOAP endpoints and does not visualize these additional protocols. On the application diagram, Web service endpoints represent a service interface that is comprised of a single set of operations available through an HTTP or SOAP binding. By default, ASP.NET applications offer both a SOAP 1.1 and SOAP 1.2 binding for these operations at the same address. While both bindings exist in the WSDL file generated for the service, the application diagram represents these as a single endpoint as long as they offer the same behavior (have the same WSDL port type).

When Web references are used to create Web service client proxy classes, and the WSDL file contains both SOAP 1.1 and SOAP 1.2 bindings for the same set of operations, the generated proxy class will use the SOAP 1.1 binding by default. If a SOAP 1.2 binding exists in the WSDL file, you can programmatically enable the proxy class to use this binding. The version of binding used affects the format of messages as transmitted at run time; however, it has no effect on the operations that are available or on the parameters that can be passed and returned. For more information about SOAP and WSDL, visit MSDN online.

For more information, see the following topics:

Connections to External Databases

When you connect an application to an external database, you can configure a database connection string for the database consumer endpoint on the consumer application. Connecting applications to the same database during application and system design specifies and documents uses of a common database. However, unlike Web service connections, there is no requirement that the database connection strings for database consumer endpoints connected to the same database need to be the same or even specify the same physical database, although it is a best practice to make sure that they do.

When you implement the database consumer application, Visual Studio generates project files that include an application configuration file. Configuring the database connection adds connection string information to this configuration file. At deployment, these database connection strings will most likely be replaced with the actual database locations. Production databases are usually not used during development and vice versa. Some parts of the connection string as defined on the application diagram might be used in production, or they might be overridden when a use of the consumer application definition is included within the context of a system.

For more information, see How to: Configure Connections to External Databases.

Deleting or Moving Connections

On the application diagram, deleting a connection leaves endpoints on applications intact so that you can reconnect them to each other or to different endpoints of compatible type without changing the application definition. For more information, see Rules for Connecting Applications on Application Diagrams.

Note

When connecting or reconnecting Web service endpoints, a ToolTip appears if the WSDL binding name and binding namespace of the consumer and provider endpoints do not match. As a best practice, the combination of WSDL binding name and binding namespace is used to define the Web service contract or behavior. You can disregard this warning and connect these endpoints; however, make sure that these endpoints are actually compatible. In addition, when connecting a Web service consumer endpoint to a different Web service provider endpoint, you will be prompted to update the consumer endpoint using the new Web service provider endpoint or leave the consumer endpoint definition unchanged. For more information, see How to: Reconnect Web Services on Application Diagrams.

Deleting a connection removes configuration information from the consumer application's configuration file. However, if a connection is required by the consumer endpoint, the consumer endpoint must be reconnected for the application to function properly. Consumer endpoints will retain some information. For example, a Web service consumer endpoint will retain information about the WSDL file location from which it was created. This might be the same as the original target location but is not required to be. This information might be used to refresh the Web reference if the Web service definition or WSDL file changes. For more information, see How to: Delete Connections from Application Diagrams.

See Also

Tasks

Walkthrough: Defining Applications on Application Diagrams

Other Resources

Defining Communication Pathways on Application Diagrams