-
Daniele Ricci wrote:
Of course I assume that by "payload" you mean also attributes.
Hm, I have re-read your post and comments and I think I understand what you mean. You probably have some custom attributes in the IQ stanza and you expect them to be copied in the "result" response send from the Tigase server. I still think the Tigase behavior is correct and it only copies attributes which are defined in the spec, that is stanza ID and form/to addresses and sets a correct type and xmlns.
I do not think it should copy any custom attributes. And to be honest, I think any custom information should not be carried out in a custom attributed. Instead a custom payload should be used. Then you have an option in the okResult API to include payload from the original IQ request.
Which API is that? Do you mean the standard Element class with all the add* methods?
Yes, I meant Element class API.
Eventually I ended up adding the additional attributes manually after ok packet creation.
Yes, this is what you are supposed to do and this is what I do in such a case.
-
Artur Hefczyc wrote:
Daniele Ricci wrote:
Of course I assume that by "payload" you mean also attributes.
Hm, I have re-read your post and comments and I think I understand what you mean. You probably have some custom attributes in the IQ stanza and you expect them to be copied in the "result" response send from the Tigase server. I still think the Tigase behavior is correct and it only copies attributes which are defined in the spec, that is stanza ID and form/to addresses and sets a correct type and xmlns.
I do not think it should copy any custom attributes. And to be honest, I think any custom information should not be carried out in a custom attributed. Instead a custom payload should be used. Then you have an option in the okResult API to include payload from the original IQ request.
Indeed. The attribute I'm trying to copy is inside a custom child element (that is, the payload you talk about).
-
Artur Hefczyc wrote:
Than, the okResult API should be good enough for you. Please note the method comes with 2 parameters which allow you to include new XML payload into the result stanza and/or retain original payload from the IQ request.
Of course. That's what I've used: it correctly copies the payload elements, but without any attributes except for the namespace which is copied manually. Here is the class that does that:
The original stanza is an iq with a custom upload element (the custom payload). This custom element has an attribute called "node" which is not copied over by okResult.
Type |
Bug
|
Priority |
Normal
|
Assignee | |
RedmineID |
2581
|
Spent time |
0
|
The okResult method does not consider the attributes from the original XML elements, it copies only the namespace:
Is that the intended behavior or is it a bug?