Ejemplo n.º 1
0
        /// <summary>Creates a new queue in the service namespace with the specified queue description.</summary>
        /// <param name="description">A
        /// <see cref="T:Microsoft.ServiceBus.Messaging.QueueDescription" /> object describing the attributes with which the new queue will be created.</param>
        /// <returns>The <see cref="T:Microsoft.ServiceBus.Messaging.QueueDescription" /> of the newly created queue.</returns>
        public QueueDescription CreateQueue(QueueDescription description)
        {
            CheckNameLength(description.Path, MAXPATHLENGTH, "description.Path");
            string queueName = description.Path;
            string address, saddress;

            GetAddressesNeeded(queueName, out address, out saddress);
            entry creationEntry = entry.Build(endpointAddresses.First(), queueName, saddress);

            creationEntry.content.QueueDescription = description.xml;
            var content   = Create(creationEntry.ToXml(), address, saddress);
            var queueDesc = new QueueDescription(description.Path, content?.QueueDescription);

            if (null != queueDesc.xml)
            {
                queueDesc.xml.ResetSerialization();
                queueDesc.xml.Path = queueName;
            }
            return(queueDesc);
        }
Ejemplo n.º 2
0
        /// <summary>Creates a new topic inside the service namespace with the specified topic description.</summary>
        /// <param name="topicDescription">A
        /// <see cref="T:Microsoft.ServiceBus.Messaging.TopicDescription" /> object describing the attributes with which the new topic will be created.</param>
        /// <returns>The <see cref="T:Microsoft.ServiceBus.Messaging.TopicDescription" /> of the newly created topic.</returns>
        public TopicDescription CreateTopic(TopicDescription topicDescription)
        {
            CheckNameLength(topicDescription.Path, MAXPATHLENGTH, "description.Path");
            string topicName = topicDescription.Path;
            string address, saddress;

            GetAddressesNeeded(topicName, out address, out saddress);
            entry creationEntry = entry.Build(endpointAddresses.First(), topicName, saddress);

            creationEntry.content.TopicDescription = topicDescription.xml;

            var content   = Create(creationEntry.ToXml(), address, saddress);
            var topicDesc = new TopicDescription(topicDescription.Path, content?.TopicDescription);

            if (null != topicDesc.xml)
            {
                topicDesc.xml.ResetSerialization();
                topicDesc.xml.Path = topicName;
            }
            return(topicDesc);
        }
Ejemplo n.º 3
0
        public SubscriptionDescription CreateSubscription(SubscriptionDescription description)
        {
            CheckNameLength(description.TopicPath, MAXPATHLENGTH, "description.Path");
            CheckNameLength(description.Name, MAXNAMELENGTH, "description.Name");
            string address, saddress;

            GetAddressesNeeded(description.TopicPath, description.Name, out address, out saddress);
            entry creationEntry = entry.Build(endpointAddresses.First(), description.Name, saddress);

            creationEntry.content.SubscriptionDescription = description.xml;
            string xml     = creationEntry.ToXml();
            var    content = Create(xml, address, saddress);
            var    subDesc = new SubscriptionDescription(description.TopicPath, description.Name, content?.SubscriptionDescription);

            if (null != subDesc.xml)
            {
                subDesc.xml.ResetSerialization();
                subDesc.xml.TopicPath = description.TopicPath;
                subDesc.xml.Name      = description.Name;
            }
            return(subDesc);
        }
Ejemplo n.º 4
0
 public static entry UploadEntryXml(this WebClient request, string saddress, entry XmlPayload)
 {
     return(request.UploadEntryXml(saddress, XmlPayload.ToXml()));
 }