Subject: Bad Request Response while using Custom Element
hai all,
i'm planning on buying Matrix component.
i want to create custom component. but i've got an error like this
my code for component is...
and i've already register my custom element
could anyone explain the problem? in agsXmpp version my code with custom component is running well.
Thanks before
i'm planning on buying Matrix component.
i want to create custom component. but i've got an error like this
<iq type="error" id="MX_1" from="madya@jakwt/MatriX" to="jakwt/8ede1f92" xmlns="jabber:client">
<weather xmlns="petrolink:weather">
<zip>74080</zip>
</weather>
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
</error>
</iq>
<weather xmlns="petrolink:weather">
<zip>74080</zip>
</weather>
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
</error>
</iq>
my code for component is...
// weather.cs
public class Weather : XmppXElement
{
public const string NAMESPACE = "petrolink:weather";
public const string TAG_NAME = "weather";
public Weather()
: base(NAMESPACE, TAG_NAME)
{
}
public int Humidity
{
get { return GetTagInt("humidity"); }
set { SetTag("humidity", value); }
}
public int Temperature
{
get { return GetTagInt("temperature"); }
set { SetTag("temperature", value); }
}
public string Zip
{
get { return GetTag("zip"); }
set { SetTag("zip", value); }
}
}
public class Weather : XmppXElement
{
public const string NAMESPACE = "petrolink:weather";
public const string TAG_NAME = "weather";
public Weather()
: base(NAMESPACE, TAG_NAME)
{
}
public int Humidity
{
get { return GetTagInt("humidity"); }
set { SetTag("humidity", value); }
}
public int Temperature
{
get { return GetTagInt("temperature"); }
set { SetTag("temperature", value); }
}
public string Zip
{
get { return GetTag("zip"); }
set { SetTag("zip", value); }
}
}
public class WeatherIq : Iq
{
public WeatherIq()
{
GenerateId();
}
public Weather Weather
{
get { return Element<Weather>(); }
set { Replace(value); }
}
}
{
public WeatherIq()
{
GenerateId();
}
public Weather Weather
{
get { return Element<Weather>(); }
set { Replace(value); }
}
}
and i've already register my custom element
private void RegisterCustomElement()
{
Factory.RegisterElement<Weather>(Weather.NAMESPACE, Weather.TAG_NAME);
}
{
Factory.RegisterElement<Weather>(Weather.NAMESPACE, Weather.TAG_NAME);
}
could anyone explain the problem? in agsXmpp version my code with custom component is running well.
Thanks before
This post was edited on 2011-07-27, 13:41 by tambunanw.