2using System.Collections.Generic;
3using System.Threading.Tasks;
27 : base(
"Xmpp/InformationQuery",
28 new KeyValuePair<Type,
Expression>(typeof(Dictionary<string, object>), new
Expression(jsonPattern)),
53 string To = (string)Parameters[
"PTo"].AssociatedObjectValue;
54 string Type = (string)Parameters[
"PType"].AssociatedObjectValue;
55 XmlDocument Query = (XmlDocument)Parameters[
"PQuery"].AssociatedObjectValue;
57 if (
string.IsNullOrEmpty(To))
63 if (Type !=
"get" && Type !=
"set")
66 if (Query.DocumentElement is
null)
82 await Client.
SendIq(
string.Empty, To, Query.DocumentElement.OuterXml, Type,
88 {
"Stanza", e.Response }
93 Result[
"errorCode"] = e.ErrorCode;
94 Result[
"errorText"] = e.ErrorText;
95 Result[
"errorType"] = e.ErrorType;
96 Result[
"ErrorElement"] = e.ErrorElement;
99 await Response.
Return(Result);
106 To,
string.Empty, Query.DocumentElement.OuterXml, async (Sender, e) =>
111 {
"Stanza", e.Response }
116 Result[
"errorCode"] = e.ErrorCode;
117 Result[
"errorText"] = e.ErrorText;
118 Result[
"errorType"] = e.ErrorType;
119 Result[
"ErrorElement"] = e.ErrorElement;
122 await Response.
Return(Result);
A Named dictionary is a dictionary, with a local name and a namespace. Use it to return content that ...
Static class managing loading of resources stored as embedded resources or in content files.
static string LoadResourceAsText(string ResourceName)
Loads a text resource from an embedded resource.
Static class managing the runtime environment of the IoT Gateway.
static CaseInsensitiveString Domain
Domain name.
static XmppClient XmppClient
XMPP Client connection of gateway.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
Represents an HTTP request.
Represets a response of an HTTP client request.
async Task Return(object Object)
Returns an object to the client. This method can only be called once per response,...
The server is currently unable to handle the request due to a temporary overloading or maintenance of...
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
Task< uint > SendIq(string Id, string To, string Xml, string Type, EventHandlerAsync< IqResultEventArgs > Callback, object State)
Sends an IQ stanza.
Static class that dynamically manages types and interfaces available in the runtime environment.
static bool TryGetModuleParameter(string Name, out object Value)
Tries to get a module parameter value.
Class managing a script expression.
string UserName
User Name.
static AccountUser AssertUserAuthenticated(HttpRequest Request)
Makes sure the request is made by an authenticated API user.
const string AgentNamespace
https://waher.se/Schema/BrokerAgent.xsd
Abstract base class for XMPP resources.
static bool IsValidJID(string JID)
Checks if a string is a valid Bare or Full JID.
Service Module hosting the XMPP broker and its components.