Project

General

Profile

Parse cusom namespace

Gabriel Rossetti
Added over 4 years ago

Hello,

I am sorry if this is somewhere, I didn't find this in the docs. I am making a custom XMPP namespace for the body of my msgs and I was wondering how I can create marshallers/unmarshallers for this, is there a standard way?

Thanks,

Gabriel


Replies (4)

Added by Gabriel Rossetti over 4 years ago

To be clear, I will be receiving and sending iq and message stanzas from a component, they will have custom data. I need to be able to recieve this turn the data into an object (unmarshal) and do the inverse when sending it. I have done this in the past with Smack but new I need to do this with Tigase, I may end up switching to the Tigase client API if I can use the same code as the server uses to marshall/unmarshall msgs. I may also use PubSub but I guess that it can use the same code?

Thanks,

Gabriel

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Tigase uses Element class for handling all XML, all incoming packets will be parsed using parser from the same project and provided with methods to access and operate all data and attributes/values. This is also used across majority of Tigase projects.

Added by Gabriel Rossetti over 4 years ago

Thanks. When you say "all incoming packets will be parsed using parser from the same project and provided with methods to access and operate all data and attributes/values.", what do you mean exactly, is this automatic? In other APIs I have used on XMPP/XML, you create a parser and associate it to a stanza/node/namespace and register it and you get an object back (or pass in an object and it is marshalled).

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Yes, all incoming data will be 'unmarshalled' so in your component you will get complete Element of received data - no need to explicitly parse it.

    (1-4/4)