Unrecognized attribute 'protocolversion'

102 views
Skip to first unread message

shriyansh jain

unread,
Jul 13, 2015, 5:24:53 AM7/13/15
to rabbitm...@googlegroups.com
HI,
When i am using WCF rabbit MQ binding it throws an error related to unknown Unrecognized attribute 'protocolversion'.


Please let me know the solution.

Michael Klishin

unread,
Jul 13, 2015, 5:27:52 AM7/13/15
to shriyansh jain, rabbitm...@googlegroups.com
 On 13 July 2015 at 12:24:56, shriyansh jain (shriya...@gmail.com) wrote:
> When i am using WCF rabbit MQ binding it throws an error related
> to unknown Unrecognized attribute 'protocolversion'.

The .NET client doesn't support multiple protocol versions any more.

You're not providing any details (your code, configuration or stack trace) but most likely
you're looking at an outdated example that tries to explicitly set protocol version.

By the way, the WCF bindings are no longer being developed. If using .NET client
directly doesn't suit you, consider EasyNetQ or MassTransit instead of the WCF binding.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


shriyansh jain

unread,
Jul 13, 2015, 5:39:17 AM7/13/15
to rabbitm...@googlegroups.com
When i use rabbitMQConfigA binding it throws an error related to unknown protocol version for rabbitMQConfigB throw an error related to unknown HostName.

Please share any demo or link for WCF binding using RabbitMQ.

 <bindings>
      <rabbitMQBinding>
        
<!--<binding name="rabbitMQConfigA"
                 hostname="localhost"
                 port="5672"
                 protocolversion="AMQP_0_9_1"
                 oneWay="false"/>-->

        <binding name="rabbitMQConfigB"
           HostName="localhost"
           Port="5672"
           Username="guest"
           Password="guest"
           VirtualHost="/"
           oneWay="true"
           MaxMessageSize="8192" />
      </rabbitMQBinding>
    </bindings>

Michael Klishin

unread,
Jul 13, 2015, 5:43:59 AM7/13/15
to shriyansh jain, rabbitm...@googlegroups.com
On 13 July 2015 at 12:39:21, shriyansh jain (shriya...@gmail.com) wrote:
> protocolversion="AMQP_0_9_1"

Remove this line. Configuring protocols is no longer supported because the client is 0-9-1 only. 

shriyansh jain

unread,
Jul 13, 2015, 7:11:06 AM7/13/15
to rabbitm...@googlegroups.com
Thanks Micheal,

Its working fine.
 Now i want to expose rest endpoint using WCF service is it possible?


On Monday, 13 July 2015 14:54:53 UTC+5:30, shriyansh jain wrote:

Michael Klishin

unread,
Jul 13, 2015, 9:06:59 AM7/13/15
to shriyansh jain, rabbitm...@googlegroups.com
On 13 July 2015 at 14:11:09, shriyansh jain (shriya...@gmail.com) wrote:
> Its working fine.
> Now i want to expose rest endpoint using WCF service is it possible?

Can you be more specific? 

shriyansh jain

unread,
Jul 13, 2015, 9:28:03 AM7/13/15
to rabbitm...@googlegroups.com, shriya...@gmail.com
Hi,
I create a Class Library project in .net an dthen host using c# Console application. Set the binding details in the App.Config in the console application project.
Now I create a new Console application Client using c# and then add the reference of class library project(which contains Inteface and class) .

I want to create a WCF application that will expose rest endpoint using rabbit MQ binding . Is it possible please let me know.

Michael Klishin

unread,
Jul 13, 2015, 9:37:39 AM7/13/15
to shriyansh jain, rabbitm...@googlegroups.com
 On 13 July 2015 at 16:28:08, shriyansh jain (shriya...@gmail.com) wrote:
> I want to create a WCF application that will expose rest endpoint
> using rabbit MQ binding . Is it possible please let me know.

You keep saying the same thing. What is your end goal? To have an HTTP API ("REST endpoint")
that communicates with other services over RabbitMQ using the WCF binding?

If so, it should be the same as producing an HTTP API that uses WCF with any other
transport.

shriyansh jain

unread,
Jul 14, 2015, 1:17:23 AM7/14/15
to rabbitm...@googlegroups.com, shriya...@gmail.com
HI  Michael Klishin,

I want to expose endpoint using rabbitMQ binding like we expose using http rest api using webHttpBinding binding in WCF.


<endpoint address="resthttp" binding="webHttpBinding" behaviorConfiguration="restbeheviour"contract="HCLT.IOT.ProvisioningService.IDeviceManagementAPI" />

<endpointBehaviors>
        <behavior name="restbeheviour">
          <webHttp helpEnabled="true" />
        </behavior>
 </endpointBehaviors>


When i use Rabbit MQ binding in wcf with the following config file it throws an error.

Could not find a base address that matches scheme soap.amqp for the endpoint with binding RabbitMQBinding. Registered base address schemes are [http].


<?xml version="1.0"?>
<configuration>

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <system.serviceModel>

    <extensions>
      <bindingExtensions>
        <add name="rabbitMQBinding"  type="RabbitMQ.ServiceModel.RabbitMQBindingSection, RabbitMQ.ServiceModel, Version=1.0.110.0, Culture=neutral, PublicKeyToken=null"/>
      </bindingExtensions>
    </extensions>

    <bindings>
      <rabbitMQBinding>       
         <binding name="OneWayRMQBinding"
                 hostname="localhost"
                 port="5672"                 
                 oneWay="false"/>
      </rabbitMQBinding>
    </bindings>

    <services>
      <service name="WCFApplication.WCFServer">
        <host>
          <baseAddresses>
            <add baseAddress="soap.amqp://amq.direct/" />
          </baseAddresses>
        </host>

        <endpoint address="OneWayService"
                  binding="rabbitMQBinding"
                  bindingConfiguration="OneWayRMQBinding"
                  contract="WCFApplication.IWCFServer" />
      </service>
    </services>

    <client>
      <endpoint name="OneWayServiceEndPoint"
                address="soap.amqp://amq.direct/OneWayService"
                binding="rabbitMQBinding"
                bindingConfiguration="OneWayRMQBinding"
                contract="WCFApplication.IWCFServer" />
    </client>
    
    
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>

Michael Klishin

unread,
Jul 14, 2015, 3:53:34 AM7/14/15
to shriyansh jain, rabbitm...@googlegroups.com
This is a WCF question, you have a much better chance of getting a response on WCF-specific forums.

MK
Reply all
Reply to author
Forward
0 new messages