none
Azure Acs with Servicebus RRS feed

  • Question

  • <p>I have donloaded the sample called<strong> RelayDemo</strong> from "<strong>jimoneil-Azure-Service-Bus-Samples-2ad1a48</strong>" and I have configured the SERVICE BUS WITH ACS in the portal and updated the solution. In which we would host the service using Service bus.</p>

    <span style="font-face:Consolas;font-size:small;"></span></span><p>But the downloaded app was with the dll of Microsoft.Servicebus of version 1.6.0.0 and I have upgraded the DLLs to 1.8.0.0 as i was facing the below error and in many posts or blogs got the solution as the Dll version issue.</p><p>The Error is&nbsp; :</p><p>Generic: There was an authorization failure. Make sure you have specified the correct SharedSecret, SimpleWebToken or Saml transport client credentials.</p><p>&nbsp;&nbsp; at Microsoft.ServiceBus.RelayedOnewayTcpClient.ConnectRequestReplyContext.Send(Message message, TimeSpan timeout, IDuplexChannel&amp; channel)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.RelayedOnewayTcpListener.RelayedOnewayTcpListenerClient.Connect(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.RelayedOnewayTcpClient.EnsureConnected(TimeSpan timeout, Boolean isRetry)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.RelayedOnewayTcpClient.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.RelayedOnewayTcpListener.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.Channels.RefcountedCommunicationObject.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.RelayedOnewayChannelListener.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.RelayedSocketListener.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.Channels.BufferedConnectionListener.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.Channels.ConnectionAcceptor.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.Channels.ConnectionDemuxer.StartDemuxing(TimeSpan timeout, OnViaDelegate viaDelegate)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.Channels.ConnectionDemuxer.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.SocketConnectionTransportManager.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.Channels.TransportManager.Open(TimeSpan timeout, TransportChannelListener channelListener)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.Channels.TransportManagerContainer.Open(TimeSpan timeout, SelectTransportManagersCallback selectTransportManagerCallback)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at Microsoft.ServiceBus.SocketConnectionChannelListener`2.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)<br />&nbsp;&nbsp; at System.ServiceModel.Channels.CommunicationObject.Open()<br />&nbsp;&nbsp; at RelayServiceHost.Main.btnServiceControl_Click(Object sender, RoutedEventArgs e) in e:\Jayashree(85355)\WCF with Service bus\New folder\jimoneil-Azure-Service-Bus-Samples-2ad1a48\jimoneil-Azure-Service-Bus-Samples-2ad1a48\RelayDemo\RelayServiceHost\MainWindow.xaml.cs:line 32</p></span></span></span><span style="font-face:Consolas;font-size:small;"><span style="font-face:Consolas;font-size:small;">host = </span></span><span style="color:#0000ff;font-face:Consolas;font-size:small;"><span style="color:#0000ff;font-face:Consolas;font-size:small;"><span style="color:#0000ff;font-face:Consolas;font-size:small;">default</span></span></span><span style="font-face:Consolas;font-size:small;"><span style="font-face:Consolas;font-size:small;">(</span></span><span style="color:#2b91af;font-face:Consolas;font-size:small;"><span style="color:#2b91af;font-face:Consolas;font-size:small;"><span style="color:#2b91af;font-face:Consolas;font-size:small;">ServiceHost</span></span></span><span style="font-face:Consolas;font-size:small;"><span style="font-face:Consolas;font-size:small;">);</span></span>

    Monday, May 13, 2013 2:10 PM

Answers

All replies

  • I have donloaded the sample called RelayDemo from
    "jimoneil-Azure-Service-Bus-Samples-2ad1a48" and I have
    configured the SERVICE BUS WITH ACS in the portal and updated the solution. In
    which we would host the service using Service bus.

    But the downloaded app was with the dll of Microsoft.Servicebus of version
    1.6.0.0 and I have upgraded the DLLs to 1.8.0.0 as i was facing the below error
    and in many posts or blogs got the solution as the Dll version issue.

    The Error is  :

    Generic: There was an authorization failure. Make sure you have specified the
    correct SharedSecret, SimpleWebToken or Saml transport client credentials.

       at
    Microsoft.ServiceBus.RelayedOnewayTcpClient.ConnectRequestReplyContext.Send(Message
    message, TimeSpan timeout, IDuplexChannel& channel)
       at
    Microsoft.ServiceBus.RelayedOnewayTcpListener.RelayedOnewayTcpListenerClient.Connect(TimeSpan
    timeout)
       at
    Microsoft.ServiceBus.RelayedOnewayTcpClient.EnsureConnected(TimeSpan timeout,
    Boolean isRetry)
       at
    Microsoft.ServiceBus.RelayedOnewayTcpClient.OnOpen(TimeSpan timeout)
       at
    System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at
    Microsoft.ServiceBus.RelayedOnewayTcpListener.OnOpen(TimeSpan timeout)
       at
    Microsoft.ServiceBus.Channels.RefcountedCommunicationObject.Open(TimeSpan
    timeout)
       at
    Microsoft.ServiceBus.RelayedOnewayChannelListener.OnOpen(TimeSpan timeout)
      
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
      
    at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan
    timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
    timeout)
       at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan
    timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
    timeout)
       at Microsoft.ServiceBus.RelayedSocketListener.Open(TimeSpan
    timeout)
       at
    Microsoft.ServiceBus.Channels.BufferedConnectionListener.Open(TimeSpan
    timeout)
       at Microsoft.ServiceBus.Channels.ConnectionAcceptor.Open(TimeSpan
    timeout)
       at
    Microsoft.ServiceBus.Channels.ConnectionDemuxer.StartDemuxing(TimeSpan timeout,
    OnViaDelegate viaDelegate)
       at
    Microsoft.ServiceBus.Channels.ConnectionDemuxer.Open(TimeSpan timeout)
       at
    Microsoft.ServiceBus.SocketConnectionTransportManager.OnOpen(TimeSpan
    timeout)
       at Microsoft.ServiceBus.Channels.TransportManager.Open(TimeSpan
    timeout, TransportChannelListener channelListener)
       at
    Microsoft.ServiceBus.Channels.TransportManagerContainer.Open(TimeSpan timeout,
    SelectTransportManagersCallback selectTransportManagerCallback)
       at
    Microsoft.ServiceBus.Channels.TransportChannelListener.OnOpen(TimeSpan
    timeout)
       at
    Microsoft.ServiceBus.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan
    timeout)
       at
    Microsoft.ServiceBus.SocketConnectionChannelListener`2.OnOpen(TimeSpan
    timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
    timeout)
       at
    System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
      
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
      
    at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
       at
    System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at
    System.ServiceModel.Channels.CommunicationObject.Open()
       at
    RelayServiceHost.Main.btnServiceControl_Click(Object sender, RoutedEventArgs e)
    in e:\Jayashree(85355)\WCF with Service bus\New
    folder\jimoneil-Azure-Service-Bus-Samples-2ad1a48\jimoneil-Azure-Service-Bus-Samples-2ad1a48\RelayDemo\RelayServiceHost\MainWindow.xaml.cs:line
    32

    Request to guide me by giving me the right link step by step or how to solve the above issue.

    The below link which i followed and downloaded the sample application

    blogs.msdn.com/b/jimoneil/archive/2012/04/24/fun-with-the-service-bus-part-1.aspx

    THANKS IN ADVANCE


    Monday, May 13, 2013 2:19 PM
  • blogs.msdn.com/b/jimoneil/archive/2012/04/24/fun-with-the-service-bus-part-1.aspx

    Link which i followed for downloading the sample

    Monday, May 13, 2013 2:34 PM
  • blogs.msdn.com/b/jimoneil/archive/2012/04/24/fun-with-the-service-bus-part-1.aspx

    Link which i followed for downloading the sample

    Monday, May 13, 2013 2:35 PM
  • Hi,

    Please check your dll referenced and the configuration files if they are the same "1.8.0.0". Usually in configuration file you still use "Version=1.6.0.0", change to "Version=1.8.0.0".

    http://blogs.msdn.com/b/narahari/archive/2011/12/26/microsoft-servicebus-authorizationfailedexception-was-unhandled.aspx

    Also check for this issue may cause the error:

    http://geekswithblogs.net/michaelstephenson/archive/2012/10/26/151083.aspx

    The newest version for service bus is 2.0. You may upgrade it, too.

    Thanks,


    QinDian Tang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 14, 2013 3:11 AM
  • Hi..

    Thanks for the reply..

    For Solution 1 :  I have checked the Dlls version properly in the configuration file and also while adding the DLLs. Inface I have taken a new solution and rebuilt again so that I should not miss anything.

    For Solution 2 : There are no gaps in the net.windows.servicebus.action  output claim.

    Request you to check the code If I have any wrong in it.

    ServiceHosthost = default(ServiceHost);

    // ServiceBusEndpoint


                host =

    newServiceHost(typeof(EchoService));

                host.AddServiceEndpoint(

    "RelayService.Interfaces.IEchoContract",

                   

    newBasicHttpRelayBinding(),

                   

    ServiceBusEnvironment.CreateServiceUri("https", "{Servicebus_Namespace}",

                       

    "EchoService"));

               

    // Add the Service Bus credentials to all endpoints specified in configuration.


               

    foreach(ServiceEndpointendpoint inhost.Description.Endpoints)

                {

                    endpoint.Behaviors.Add(

    newTransportClientEndpointBehavior()

                        {

                            TokenProvider =

    TokenProvider.CreateSharedSecretTokenProvider(

                               

    "owner", "**************")

                           

    //Properties.Settings.Default.SBListenerCredentials)


                        });

                }

    return

    host;

    But in tha sample for shared secret Token provider asked for the ACS symmetric key. What should be given For the issure Name and the Issure key.

    Please guide me.

    Tuesday, May 14, 2013 6:09 AM
  • Hi,

    Issuer name and key are from the management portal. You can select the Service Bus node from the left side and select the namespace you created for this. In the bottom side there is a "Access Key" button. There you can get the name and key, just copy them to input in your code.

    Thanks,


    QinDian Tang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 14, 2013 6:39 AM
  • Could you please help me out ,how to host the Servicebus with ACS code relay. And am not finding the correct way how to host the WCF using Service bus with ACS. Any link in which I could start from the base as am not getting the proper link to host the service using Service bus. Thanks a lot for the help :)
    Tuesday, May 14, 2013 11:30 AM
  • Hi,

    Have a look at these articles about WCF with service bus relay and ACS authentication:

    http://acaseyblog.wordpress.com/2013/03/22/securing-and-authenticating-azure-service-bus-relay-messages-using-a-shared-secret/

    http://blog.repsaj.nl/index.php/2013/04/wcf-service-using-azure-relay-and-adfs-authentication-12/

    Thanks,


    QinDian Tang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 15, 2013 2:33 AM