I am trying to create a rule for an AppFabric Topic subscription using REST API.
First I create a topic, then I create a subscription and finally I want to create a rule that will filter messages for my subscription.
I succeeded to create the topic and the subscription but when I sent the PUT request to create the rule I Got a 400 error –
"Bad request".
var ruleAddress = string.Format("https://{0}.servicebus.windows.net/{1}/subscriptions/{2}/rules/{3}", serviceNamespace, topicName, subscriptionName, druleName);
WebClient webClient = new WebClient();
webClient.Headers[HttpRequestHeader.Authorization] = token;
var putData = @"<entry xmlns=""http://www.w3.org/2005/Atom"">
<title type=""text"">testrule</title>
<content type=""application/xml"">
<RuleDescription xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"">
<Filter i:type=""SqlFilterExpression"">
<SqlExpression>To='myvalue'</SqlExpression>
</Filter>
</RuleDescription>
</content>
</entry>";
webClient.UploadData(ruleAddress, "PUT", Encoding.UTF8.GetBytes(putData));
Does anyone know where I can find an example that demonstrates how to create a rule using the REST api? Or even better does anyone know why do I get the "Bad request Error"?
Thanks
Manu
Manu