Including a One-Way External Service Endpoint
This topic provides instructions to add a one-way external service endpoint to an Enterprise Application Integration project. Use this to route a message to a WCF external service that takes a request but does not return anything in response.
Important |
|---|
| The service you wish to represent as part of the Enterprise Application Integration project must already be configured. You cannot configure a service as part of the Enterprise Application Integration project. |
Create an Enterprise Application Integration project, as described in How to Create an Enterprise Application Integration Project.
Right-click anywhere on the Enterprise Application Integration project design surface, select Properties, and then for the Service Namespace property, specify the registered service namespace, for example MyNamespace.
Note For the current release, the Enterprise Application Integration project mandates that all the components that are part of the project must belong to the same Service Bus namespace. From the Toolbox, drag and drop the One-Way External Service Endpoint component to the Enterprise Application Integration project design surface.
Note This adds a configuration file to the Enterprise Application Integration project. For more information about the configuration file, see Step 5. Right-click the component, and then select Properties. The following table provides information about the properties:
Property Name Description Address
This is a read-only field and cannot be changed from the Properties pane. You can change the address either directly in the associated .config file or from the Service Configuration Editor, which is launched by double-clicking the One-Way External Service Endpoint component, as explained in Step 5(a).
Associated Project Item
This is a read-only field and provides the name of the associated .config file. If you change the name of the component on the Enterprise Application Integration project design surface by changing the Entity Name property, the name of the .config file also changes.
Endpoint Configuration Name
Name of the client endpoint configuration in the .config file that defines the address, binding, and contract for the WCF service that you are representing on the Enterprise Application Integration project design surface. Because the service configuration file can have any number of endpoints defined, the endpoint name you specify for this property is matched with the endpoint configuration name in the .config file. When a match happens, the corresponding address, binding, and contract for that endpoint are considered.
Important The value you specify for this property is not used for updating the name attribute of the endpoint element in the associated .config file.
Important You must ensure that the associated .config file has at least one endpoint defined with the name you specify here. You can either update the .config manually to create the endpoint or use the Service Configuration Editor, as explained in Step 5(a).Entity Name
The name of the external service component on the Enterprise Application Integration project design surface. This name should be unique for an Enterprise Application Integration project.
Runtime Address
The public runtime endpoint URL where the external service is deployed.
When you drop the One-Way External Service Endpoint component on the Enterprise Application Integration project design surface, it adds a configuration file with the same name as the value you provided for the Entity Name. This configuration file must be updated to provide information about the external service’s client endpoint such as the service binding and service contract. Perform the following steps to update the configuration file.
Double-click the One-Way External Service Endpoint component on the Enterprise Application Integration project design surface to open the Service Configuration Editor.
Expand Endpoints node under the Client node in the Tree View pane, to see the default endpoint already created. Click the default endpoint and in the Client Endpoint details pane, in the General tab, enter the following properties.
Property Name Description Name
Update the endpoint configuration name, for example, OneWayExternalService.
Important Whatever value you enter here, you must specify the same value for the Endpoint Configuration Name property.Address
The complete address where the external one-way service is hosted, for example, https://MyServices/myOneWayExternalService.
BehaviorConfiguration
If you want to include a custom endpoint behavior configuration, and if you already have it configured as part of the Service Configuration Editor under the Endpoint Behaviors node, you can select that from the drop-down list. For instructions on how to add a behavior configuration, see To add a behavior configuration.
Binding
Specifies the type of binding you want to use for the endpoint. For example, for a WCF external service endpoint, you can choose basicHttpBinding.
BindingConfiguration
Using this you can specify more details about the binding such as security requirements, etc. If you want to include a binding configuration, and if you already have it configured as part of the Service Configuration Editor under the Bindings node, you can select that from the drop-down list. For instructions on how to add a binding configuration, see To add a binding configuration.
Contract
Specify the contract for the service. For a WCF one-way external service, the contract must be System.ServiceModel.Routing.ISimplexDatagramRouter.
From the File menu, click Save and then click Exit.
Open the configuration file and verify that the values you entered in the Service Configuration Editor are reflected in the configuration file. A sample configuration file for an external one-way service endpoint would look like the following:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="ServiceBinding"> <security mode="Transport"> <transport clientCredentialType="None"> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint behaviorConfiguration="ServiceCredentialBehavior" address="http://MyServices/myOneWayExternalService" binding="basicHttpBinding" bindingConfiguration="ServiceBinding" contract="System.ServiceModel.Routing.ISimplexDatagramRouter" name="OneWayExternalService" /> </client> </system.serviceModel> </configuration>
In the Service Configuration Editor, from the Tree View pane, expand Advanced, right-click Endpoint Behaviors, and then click New Endpoint Behavior Configuration.
In the Behavior details pane, specify a name for the behavior, for example, ServiceCredentialBehavior. The same name will be available in the BehaviorConfiguration drop-down list in Step 4(b) above.
In the Behavior element extension position area, click Add, from the Available Elements box, select the element that you want to add, and then click Add again.
In the Tree View pane, go back to the service endpoint that you created, and select the newly created endpoint behavior configuration from the BehaviorConfiguration drop-down list.
In the Service Configuration Editor, from the Tree View pane, right-click Bindings, and then click New Binding Configuration.
In the Create a New Binding box, select the same binding that you specified in Step 4(b) above, and then click OK.
In the binding details pane, on the Binding tab, for the Name property, specify a name for the binding configuration, for example ServiceBinding. The same name will be available in the BindingConfiguration drop-down list in Step 4 (b) above.
In the binding details pane, on the Security tab, for the Mode drop-down list, select Transport and for the TransportClientCredentialType option, select None.
In the Tree View pane, go back to the service endpoint that you created, and select the newly created binding configuration from the BindingConfiguration drop-down list.
If you save and exit the configuration editor now, and open the configuration file in an XML editor, you will notice that the following has been added to the service configuration file. This excerpt assumes that the binding you selected was basicHttpBinding.
<bindings> <basicHttpBinding> <binding name="ServiceBinding"> <security mode="Transport"> <transport clientCredentialType="None" /> </security> </binding> </basicHttpBinding> </bindings>