Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Can't access Service Bus via HTTP REST

$
0
0

Hello,

I have Service Bus for Windows Server 1.1 and I want to connect to a queue via HTTP REST protocol.

I can get a token using the following address :

 https://ppatierno-pc:9355/ServiceBusDefaultNamespace/

With my account credentials but when I try to connect to the queue, I receive the error on connection to the remote server.

The code is the following:

string body = "foo";

            string token = GetOAuthAccessToken(new
                Uri("https://ppatierno-pc:9355/ServiceBusDefaultNamespace/"),"myuser", "mypassword", TimeSpan.FromMinutes(10));
            string fullAddress = "http://ppatierno-PC/ServiceBusDefaultNamespace/testqueue/messages";
            WebClient webClient = new WebClient();
            webClient.Headers[HttpRequestHeader.Authorization] = token;
            webClient.Headers["Content-Type"] = "text/plain";
            webClient.UploadData(fullAddress, "POST", Encoding.UTF8.GetBytes(body));   

Why ?

Thanks,

Paolo.

 

Paolo Patierno


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>