3using System.Threading.Tasks;
28 : base(
"Xmpp/InformationQuery",
29 new KeyValuePair<Type,
Expression>(typeof(Dictionary<string, object>), new
Expression(jsonPattern)),
54 string To = (string)Parameters[
"PTo"].AssociatedObjectValue;
55 string Type = (string)Parameters[
"PType"].AssociatedObjectValue;
56 XmlDocument Query = (XmlDocument)Parameters[
"PQuery"].AssociatedObjectValue;
58 if (
string.IsNullOrEmpty(To))
64 if (Type !=
"get" && Type !=
"set")
67 if (Query.DocumentElement is
null)
83 await Client.
SendIq(
string.Empty, To, Query.DocumentElement.OuterXml, Type,
89 {
"Stanza", e.Response }
94 Result[
"errorCode"] = e.ErrorCode;
95 Result[
"errorText"] = e.ErrorText;
96 Result[
"errorType"] = e.ErrorType;
97 Result[
"ErrorElement"] = e.ErrorElement;
100 await Response.
Return(Result);
107 To,
string.Empty, Query.DocumentElement.OuterXml,
false, async (Sender, e) =>
112 {
"Stanza", e.Response }
117 Result[
"errorCode"] = e.ErrorCode;
118 Result[
"errorText"] = e.ErrorText;
119 Result[
"errorType"] = e.ErrorType;
120 Result[
"ErrorElement"] = e.ErrorElement;
123 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 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.
Task Return(Exception ex)
Returns an error to the client.
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 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 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.