Example #1
0
 public XmlDocument DoAction(SoapAction _soapAction)
 {
     this.soapAction = _soapAction;
     string _xmlResponse = Common.GetRouterSoapResponse(this);
     XmlDocument xmlResponse = new XmlDocument();
     xmlResponse.LoadXml(_xmlResponse);
     return xmlResponse;
 }
 public void setUp()
 {
     var soapAction = new SoapAction("myaction", "http://mynamespace.com");
     soapAction.addParameterPairToAction("clientPassword", "mypassword");
     soapAction.addParameterPairToAction("clientUsername", "myusername");
     soapAction.addParameterPairToAction("securityToken", "mysecuritytoken");
     soapAction.addParameterPairToAction("eventStatus", "mystatus");
     var soapXmlGenerator = new SoapXMLGenerator(soapAction);
     soapPayload = soapXmlGenerator.generateSoapXmlDocument().OuterXml;
 }
Example #3
0
        /// <summary>
        ///     Executes the SetAutoplayLinkedZones action.
        /// </summary>
        /// <param name="includeLinkedZones">In value for the IncludeLinkedZones action parameter.</param>
        public async Task SetAutoplayLinkedZones(Boolean includeLinkedZones)
        {
            var loIn = new object[1];

            loIn[0] = includeLinkedZones;
            var action = new SoapAction
            {
                ArgNames           = new[] { "IncludeLinkedZones" },
                Name               = CsActionSetAutoplayLinkedZones,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #4
0
        /// <summary>
        ///     Executes the SetAutoplayRoomUUID action.
        /// </summary>
        /// <param name="roomUuid">In value for the RoomUUID action parameter.</param>
        public async Task SetAutoplayRoomUuid(String roomUuid)
        {
            var loIn = new object[1];

            loIn[0] = roomUuid;
            var action = new SoapAction
            {
                ArgNames           = new[] { "RoomUUID" },
                Name               = CsActionSetAutoplayRoomUuid,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #5
0
        /// <summary>
        ///     Executes the SetTimeServer action.
        /// </summary>
        /// <param name="desiredTimeServer">In value for the DesiredTimeServer action parameter.</param>
        public async Task SetTimeServer(String desiredTimeServer)
        {
            var loIn = new object[1];

            loIn[0] = desiredTimeServer;
            var action = new SoapAction
            {
                ArgNames           = new[] { "DesiredTimeServer" },
                Name               = CsActionSetTimeServer,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #6
0
        /// <summary>
        ///     Executes the SetUseAutoplayVolume action.
        /// </summary>
        /// <param name="useVolume">In value for the UseVolume action parameter.</param>
        public async Task SetUseAutoplayVolume(Boolean useVolume)
        {
            var loIn = new object[1];

            loIn[0] = useVolume;
            var action = new SoapAction
            {
                ArgNames           = new[] { "UseVolume" },
                Name               = CsActionSetUseAutoplayVolume,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #7
0
        /// <summary>
        ///     Executes the RemoveBondedZones action.
        /// </summary>
        /// <param name="channelMapSet">In value for the ChannelMapSet action parameter.</param>
        public async Task RemoveBondedZones(String channelMapSet)
        {
            var loIn = new object[1];

            loIn[0] = channelMapSet;
            var action = new SoapAction
            {
                ArgNames           = new[] { "ChannelMapSet" },
                Name               = CsActionRemoveBondedZones,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #8
0
        /// <summary>
        ///     Executes the SeparateStereoPair action.
        /// </summary>
        /// <param name="channelMapSet">In value for the ChannelMapSet action parameter.</param>
        public async Task SeparateStereoPair(String channelMapSet)
        {
            var loIn = new object[1];

            loIn[0] = channelMapSet;
            var action = new SoapAction
            {
                ArgNames           = new[] { "ChannelMapSet" },
                Name               = CsActionSeparateStereoPair,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #9
0
        /// <summary>
        ///     Executes the SetInvisible action.
        /// </summary>
        /// <param name="desiredInvisible">In value for the DesiredInvisible action parameter.</param>
        public async Task SetInvisible(Boolean desiredInvisible)
        {
            var loIn = new object[1];

            loIn[0] = desiredInvisible;
            var action = new SoapAction
            {
                ArgNames           = new[] { "DesiredInvisible" },
                Name               = CsActionSetInvisible,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #10
0
        /// <summary>
        ///     Executes the SetLEDState action.
        /// </summary>
        /// <param name="desiredLedState">In value for the DesiredLEDState action parameter.</param>
        public async Task SetLedState(LedStateEnum desiredLedState)
        {
            var loIn = new object[1];

            loIn[0] = DeviceProperties.ToStringLedState(desiredLedState);
            var action = new SoapAction
            {
                ArgNames           = new[] { "DesiredLEDState" },
                Name               = CsActionSetLedState,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #11
0
        /// <summary>
        ///     Executes the DestroyAlarm action.
        /// </summary>
        /// <param name="iD">In value for the ID action parameter.</param>
        public async Task DestroyAlarm(UInt32 iD)
        {
            var loIn = new object[1];

            loIn[0] = iD;
            var action = new SoapAction
            {
                ArgNames           = new[] { "ID" },
                Name               = CsActionDestroyAlarm,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #12
0
        /// <summary>
        ///     Executes the SetDailyIndexRefreshTime action.
        /// </summary>
        /// <param name="desiredDailyIndexRefreshTime">In value for the DesiredDailyIndexRefreshTime action parameter.</param>
        public async Task SetDailyIndexRefreshTime(String desiredDailyIndexRefreshTime)
        {
            var loIn = new object[1];

            loIn[0] = desiredDailyIndexRefreshTime;
            var action = new SoapAction
            {
                ArgNames           = new[] { "DesiredDailyIndexRefreshTime" },
                Name               = CsActionSetDailyIndexRefreshTime,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #13
0
        /// <summary>
        ///     Executes the SetTimeNow action.
        /// </summary>
        /// <param name="desiredTime">In value for the DesiredTime action parameter.</param>
        /// <param name="timeZoneForDesiredTime">In value for the TimeZoneForDesiredTime action parameter.</param>
        public async Task SetTimeNow(String desiredTime, String timeZoneForDesiredTime)
        {
            var loIn = new object[2];

            loIn[0] = desiredTime;
            loIn[1] = timeZoneForDesiredTime;
            var action = new SoapAction
            {
                ArgNames           = new[] { "DesiredTime", "TimeZoneForDesiredTime" },
                Name               = CsActionSetTimeNow,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #14
0
        /// <summary>
        ///     Executes the SetTreble action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="desiredTreble">In value for the DesiredTreble action parameter. With range of -10 to 10. Increment of 1.</param>
        public async Task SetTreble(UInt32 instanceId, Int16 desiredTreble)
        {
            var loIn = new object[2];

            loIn[0] = instanceId;
            loIn[1] = desiredTreble;
            var action = new SoapAction
            {
                ArgNames           = new[] { "InstanceID", "DesiredTreble" },
                Name               = CsActionSetTreble,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
        /// <summary>
        ///     Executes the BeginSoftwareUpdate action.
        /// </summary>
        /// <param name="updateUrl">In value for the UpdateURL action parameter.</param>
        /// <param name="flags">In value for the Flags action parameter.</param>
        public async Task BeginSoftwareUpdate(String updateUrl, UInt32 flags)
        {
            var loIn = new object[2];

            loIn[0] = updateUrl;
            loIn[1] = flags;
            var action = new SoapAction
            {
                ArgNames           = new[] { "UpdateURL", "Flags" },
                Name               = CsActionBeginSoftwareUpdate,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #16
0
        /// <summary>
        ///     Executes the GetShareIndexInProgress action.
        /// </summary>
        /// <returns>Out value for the IsIndexing action parameter.</returns>
        public async Task <ActionResult> GetShareIndexInProgress()
        {
            var loIn = new object[0];

            var action = new SoapAction
            {
                ArgNames           = new[] { "IsIndexing" },
                Name               = CsActionGetShareIndexInProgress,
                ExpectedReplyCount = 1
            };
            var result = await InvokeActionAsync(action, loIn);

            // TODO: check for execption
            return(new ActionResult(result.XElement));
        }
Example #17
0
        /// <summary>
        ///     Executes the DestroyObject action.
        /// </summary>
        /// <param name="objectId">In value for the ObjectID action parameter.</param>
        public async Task DestroyObject(String objectId)
        {
            var loIn = new object[1];

            loIn[0] = objectId;

            var action = new SoapAction
            {
                ArgNames           = new[] { "ObjectID" },
                Name               = CsActionDestroyObject,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #18
0
        /// <summary>
        ///     Executes the SetZoneAttributes action.
        /// </summary>
        /// <param name="desiredZoneName">In value for the DesiredZoneName action parameter.</param>
        /// <param name="desiredIcon">In value for the DesiredIcon action parameter.</param>
        public async Task SetZoneAttributes(String desiredZoneName, String desiredIcon)
        {
            var loIn = new object[2];

            loIn[0] = desiredZoneName;
            loIn[1] = desiredIcon;
            var action = new SoapAction
            {
                ArgNames           = new[] { "DesiredZoneName", "DesiredIcon" },
                Name               = CsActionSetZoneAttributes,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #19
0
        /// <summary>
        ///     Executes the RestoreVolumePriorToRamp action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="channel">In value for the Channel action parameter.</param>
        public async Task RestoreVolumePriorToRamp(UInt32 instanceId, AargtypeChannelEnum channel)
        {
            var loIn = new object[2];

            loIn[0] = instanceId;
            loIn[1] = RenderingControlExtensions.ToStringAargtypeChannel(channel);
            var action = new SoapAction
            {
                ArgNames           = new[] { "InstanceID", "Channel" },
                Name               = CsActionRestoreVolumePriorToRamp,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #20
0
        /// <summary>
        ///     Executes the SetOutputFixed action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="desiredFixed">In value for the DesiredFixed action parameter.</param>
        public async Task SetOutputFixed(UInt32 instanceId, Boolean desiredFixed)
        {
            var loIn = new object[2];

            loIn[0] = instanceId;
            loIn[1] = desiredFixed;
            var action = new SoapAction
            {
                ArgNames           = new[] { "InstanceID", "DesiredFixed" },
                Name               = CsActionSetOutputFixed,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #21
0
        /// <summary>
        ///     Executes the ReportTrackBufferingResult action.
        /// </summary>
        /// <param name="memberId">In value for the MemberID action parameter.</param>
        /// <param name="resultCode">In value for the ResultCode action parameter.</param>
        public async Task ReportTrackBufferingResult(String memberId, Int32 resultCode)
        {
            var loIn = new object[2];

            loIn[0] = memberId;
            loIn[1] = resultCode;
            var action = new SoapAction
            {
                ArgNames           = new[] { "MemberID", "ResultCode" },
                Name               = CsActionRemoveMember,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #22
0
        /// <summary>
        ///     Executes the RequestResort action.
        /// </summary>
        /// <param name="sortOrder">In value for the SortOrder action parameter.</param>
        public async Task RequestResort(String sortOrder)
        {
            var loIn = new object[1];

            loIn[0] = sortOrder;

            var action = new SoapAction
            {
                ArgNames           = new[] { "SortOrder" },
                Name               = CsActionRequestResort,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #23
0
        /// <summary>
        ///     Executes the ImportSetting action.
        /// </summary>
        /// <param name="settingId">In value for the SettingID action parameter. With range of 0 to 65535.</param>
        /// <param name="settingUri">In value for the SettingURI action parameter.</param>
        public async Task ImportSetting(UInt32 settingId, String settingUri)
        {
            var loIn = new object[2];

            loIn[0] = settingId;
            loIn[1] = settingUri;
            var action = new SoapAction
            {
                ArgNames           = new[] { "SettingID", "SettingURI" },
                Name               = CsActionImportSetting,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #24
0
        /// <summary>
        ///     Executes the SetBrowseable action.
        /// </summary>
        /// <param name="browseable">In value for the Browseable action parameter.</param>
        public async Task SetBrowseable(Boolean browseable)
        {
            var loIn = new object[1];

            loIn[0] = browseable;

            var action = new SoapAction
            {
                ArgNames           = new[] { "Browseable" },
                Name               = CsActionSetBrowseable,
                ExpectedReplyCount = 1
            };

            await InvokeActionAsync(action, loIn);
        }
Example #25
0
        /// <summary>
        ///     Executes the SetChannelMap action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="channelMap">In value for the ChannelMap action parameter.</param>
        public async Task SetChannelMap(UInt32 instanceId, String channelMap)
        {
            var loIn = new object[2];

            loIn[0] = instanceId;
            loIn[1] = channelMap;
            var action = new SoapAction
            {
                ArgNames           = new[] { "InstanceID", "ChannelMap" },
                Name               = CsActionSetChannelMap,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #26
0
        private static string CreateSoapMessageBody(SoapAction sa, UpnpArgumentList list)
        {
            var body = new StringBuilder();

            body.Append($"<u:{sa.Action} xmlns:u=\"{sa.ActionNamespace}\">");

            foreach (var property in list.Arguments)
            {
                body.Append($"<{property.Name}>{property.Value}</{property.Name}>");
            }

            body.Append($"</u:{sa.Action}>");

            return(body.ToString());
        }
Example #27
0
        /// <summary>
        ///     Executes the SetTimeZone action.
        /// </summary>
        /// <param name="index">In value for the Index action parameter.</param>
        /// <param name="autoAdjustDst">In value for the AutoAdjustDst action parameter.</param>
        public async Task SetTimeZone(Int32 index, Boolean autoAdjustDst)
        {
            var loIn = new object[2];

            loIn[0] = index;
            loIn[1] = autoAdjustDst;
            var action = new SoapAction
            {
                ArgNames           = new[] { "Index", "AutoAdjustDst" },
                Name               = CsActionSetTimeZone,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #28
0
        /// <summary>
        ///     Executes the ProvisionTrialAccount action.
        /// </summary>
        /// <param name="accountType">In value for the AccountType action parameter.</param>
        public async Task ProvisionTrialAccount(UInt32 accountType)
        {
            var loIn = new object[1];

            loIn[0] = accountType;

            var action = new SoapAction
            {
                ArgNames           = new[] { "AccountType" },
                Name               = CsActionProvisionTrialAccount,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #29
0
        /// <summary>
        ///     Executes the ResetExtEQ action.
        /// </summary>
        /// <param name="instanceId">In value for the InstanceID action parameter.</param>
        /// <param name="eQType">In value for the EQType action parameter.</param>
        public async Task ResetExtEq(UInt32 instanceId, String eQType)
        {
            var loIn = new object[2];

            loIn[0] = instanceId;
            loIn[1] = eQType;
            var action = new SoapAction
            {
                ArgNames           = new[] { "InstanceID", "EQType" },
                Name               = CsActionResetExtEq,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
Example #30
0
        /// <summary>
        ///     Executes the Remove action.
        /// </summary>
        /// <param name="variableName">In value for the VariableName action parameter.</param>
        public async Task Remove(String variableName)
        {
            var loIn = new object[1];

            loIn[0] = variableName;

            var action = new SoapAction
            {
                ArgNames           = new[] { "VariableName" },
                Name               = CsActionRemove,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
        /// <summary>
        ///     Executes the GetCurrentConnectionIDs action.
        /// </summary>
        /// <returns>Out value for the ConnectionIDs action parameter.</returns>
        public async Task <ActionResult> GetCurrentConnectionIDs()
        {
            var loIn = new object[0];

            var action = new SoapAction
            {
                ArgNames           = new string[0],
                Name               = CsActionGetCurrentConnectionIDs,
                ExpectedReplyCount = 1
            };
            SoapActionResult result = await InvokeActionAsync(action, loIn);

            // TODO: check for execption
            return(new ActionResult(result.XElement));
        }
Example #32
0
        /// <summary>
        ///     Executes the SetStringX action.
        /// </summary>
        /// <param name="variableName">In value for the VariableName action parameter.</param>
        /// <param name="stringValue">In value for the StringValue action parameter.</param>
        public async Task SetStringX(String variableName, String stringValue)
        {
            var loIn = new object[2];

            loIn[0] = variableName;
            loIn[1] = stringValue;
            var action = new SoapAction
            {
                ArgNames           = new[] { "VariableName", "StringValue" },
                Name               = CsActionSetStringX,
                ExpectedReplyCount = 0
            };

            await InvokeActionAsync(action, loIn);
        }
 public void setUp()
 {
     String action = "operation";
     String xmlnamespace = "actionNamespace";
     soapAction = new SoapAction(action, xmlnamespace);
 }