The behavior element has an invalid child element of transportClientEndpointBehavior also basicHttpRelayBinding

I can get this error in Visual Studio when creating a WCF configuration file, since the VS editor is not aware of this extension. I need to know where to place transportClientEndpointBehavior, any help? thank.

 <behaviors>
  <endpointBehaviors>
    <behavior name="sharedSecretClientCredentials">
      <transportClientEndpointBehavior credentialType="SharedSecret">
        <clientCredentials>
          <sharedSecret issuerName="***********" issuerSecret="**********" />
        </clientCredentials>
      </transportClientEndpointBehavior>
      <ServiceRegistrySettings discoveryMode="Public"/>
    </behavior>
  </endpointBehaviors>
  ...
</behaviors>

I also have a problem with basicHttpRelayBinding, which I suppose to include in bindings.

+3
source share
3 answers

There is a sample in the Windows Azure platform training kit that does this programmatically. Here is an snippit example ...

// create the service URI based on the service namespace
        Uri address = ServiceBusEnvironment.CreateServiceUri("sb",
                      serviceNamespaceDomain, "EchoService");

        // create the credential object for the endpoint
        TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior();
        sharedSecretServiceBusCredential.CredentialType = TransportClientCredentialType.SharedSecret;
        sharedSecretServiceBusCredential.Credentials.SharedSecret.IssuerName = issuerName;
        sharedSecretServiceBusCredential.Credentials.SharedSecret.IssuerSecret = issuerSecret;

        // create the service host reading the configuration
        ServiceHost host = new ServiceHost(typeof(EchoService), address);

        // create the ServiceRegistrySettings behavior for the endpoint
        IEndpointBehavior serviceRegistrySettings = new ServiceRegistrySettings(DiscoveryType.Public);

        // add the Service Bus credentials to all endpoints specified in configuration
        foreach (ServiceEndpoint endpoint in host.Description.Endpoints)
        {
            endpoint.Behaviors.Add(sharedSecretServiceBusCredential);
        }

        // open the service
        host.Open();
0
source

AppFabric SDK? ServiceRegistrySettings ServiceRegistrySettings.

0

Visual Studio Intellisense uses built-in schemas to perform validations. Therefore, it will not recognize the extension of the behavior of transportClientEndpointBehavior and display a warning. Ignore this warning.

Answer from "20487B-ENU-TrainerHandbook.pdf", which is the official Microsoft training book. Page 278

0
source

Source: https://habr.com/ru/post/1795531/


All Articles