Subject: ComBase - manipulate message.From tag - problems
Hello,
i like your agsXMPP package very much.
After a little playing around i tried to do the following.
The plan is to create some kind of doorman and some services.
The user sends a request to the doorman.
The doorman decides if the user is valid for the requested service.
After this decition the doorman should send an request to the requested service.
Everything works really great till here.
The doorman creates a message (type agsXMPP.protocol.client.message).
I tried the change the message.From value. I tried the set the JID of the user instead of the JID of the doorman.
(
first try:
Message msg = new Message();
msg.Body = receive.Body; (receive is the message the doorman gets from the user)
msg.From = receive.From;
msg.To = new JID("service@server.de");
this.comBase.Send(msg);
second try:
Message msg = new Message();
msg.Body = receive.Body; (receive is the message the doorman gets from the user)
msg.From = new JID("user@server.de");
msg.To = new JID("service@server.de");
this.comBase.Send(msg);
)
I did it cause i thought the service could send the request-answer direct to the user and not to the doorman.
This means the communication way is: user -> doorman -> service -> user
All user/doorman/services are authenticated against eachother.
I thought this is a good idea in case of loadbalancing and single point of contact.
In case of debugging i log every xml which passes the ComBase (receive and send).
I saw that the message from the doorman to the service is correct (correct means the right FROM and TO tag).
But after this message the comBase sends a second message (id 24900 in the MessageLog) with wrong FROM tag.
The FROM tag is changed to the JID of the doorman.
(
MessageLog:
| 24901
- 2007-10-12 17:19:03
- <message xmlns="jabber:component:accept" to="doorman@server.de/agsXMPP" from="service@server.de/agsXMPP"><body>Hamburg</body></message>
- XmppComBase - OnWriteXml
| 24900
- 2007-10-12 17:19:02
- <message xmlns="jabber:client" from="doorman@server.de/agsXMPP" xml:lang="en" to="service@server.de/agsXMPP"><body>hamburg</body></message>
- XmppComBase - OnRead
| 24899
- 2007-10-12 17:19:02
- <message xmlns="jabber:client" to="service@server.de/agsXMPP" from="user@server.de/Pandion2"><body>hamburg</body></message>
- XmppComBase - OnWriteXml
| 24898
- 2007-10-12 17:19:02
- <message xmlns="jabber:client" from="user@server.de/Pandion2" type="chat" id="mir_23" to="doorman@server.de/agsXMPP"><body>hamburg</body><x xmlns="jabber:x:event"><composing /></x></message>
- XmppComBase - OnRead
)
The service replais only to the second message (the wrong one).
So the user never gets an answer cause the service answers to the doorman cause of the wrong FROM tag in the second message.
I don´t know why the combase acts like this.
Is there a problem in my implementation?
I hope you got my point you can help me.
Best regards
Hudson
i like your agsXMPP package very much.
After a little playing around i tried to do the following.
The plan is to create some kind of doorman and some services.
The user sends a request to the doorman.
The doorman decides if the user is valid for the requested service.
After this decition the doorman should send an request to the requested service.
Everything works really great till here.
The doorman creates a message (type agsXMPP.protocol.client.message).
I tried the change the message.From value. I tried the set the JID of the user instead of the JID of the doorman.
(
first try:
Message msg = new Message();
msg.Body = receive.Body; (receive is the message the doorman gets from the user)
msg.From = receive.From;
msg.To = new JID("service@server.de");
this.comBase.Send(msg);
second try:
Message msg = new Message();
msg.Body = receive.Body; (receive is the message the doorman gets from the user)
msg.From = new JID("user@server.de");
msg.To = new JID("service@server.de");
this.comBase.Send(msg);
)
I did it cause i thought the service could send the request-answer direct to the user and not to the doorman.
This means the communication way is: user -> doorman -> service -> user
All user/doorman/services are authenticated against eachother.
I thought this is a good idea in case of loadbalancing and single point of contact.
In case of debugging i log every xml which passes the ComBase (receive and send).
I saw that the message from the doorman to the service is correct (correct means the right FROM and TO tag).
But after this message the comBase sends a second message (id 24900 in the MessageLog) with wrong FROM tag.
The FROM tag is changed to the JID of the doorman.
(
MessageLog:
| 24901
- 2007-10-12 17:19:03
- <message xmlns="jabber:component:accept" to="doorman@server.de/agsXMPP" from="service@server.de/agsXMPP"><body>Hamburg</body></message>
- XmppComBase - OnWriteXml
| 24900
- 2007-10-12 17:19:02
- <message xmlns="jabber:client" from="doorman@server.de/agsXMPP" xml:lang="en" to="service@server.de/agsXMPP"><body>hamburg</body></message>
- XmppComBase - OnRead
| 24899
- 2007-10-12 17:19:02
- <message xmlns="jabber:client" to="service@server.de/agsXMPP" from="user@server.de/Pandion2"><body>hamburg</body></message>
- XmppComBase - OnWriteXml
| 24898
- 2007-10-12 17:19:02
- <message xmlns="jabber:client" from="user@server.de/Pandion2" type="chat" id="mir_23" to="doorman@server.de/agsXMPP"><body>hamburg</body><x xmlns="jabber:x:event"><composing /></x></message>
- XmppComBase - OnRead
)
The service replais only to the second message (the wrong one).
So the user never gets an answer cause the service answers to the doorman cause of the wrong FROM tag in the second message.
I don´t know why the combase acts like this.
Is there a problem in my implementation?
I hope you got my point you can help me.
Best regards
Hudson