Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
sreedevi1984 #1
Member since Oct 2006 · 38 posts
Group memberships: Members
Show profile · Link to this post
Subject: File transferring
I am able to construct the xml

"<iq xmlns=\"jabber:client\" id=\"agsXMPP_5\" to=\"abc@localhost\" type=\"set\">
<si xmlns=\"http://jabber.org/protocol/si\" profile=\"http://jabber.org/protocol/si/profile/file-transfer\" id=\"e9f40293-8b03-42dc-b134-d5d0d8a3d12c\">
<file xmlns=\"http://jabber.org/protocol/si/profile/file-transfer\" name=\"agsxmpp.chm\" size=\"2463170\">
<range />
</file>
<feature xmlns=\"http://jabber.org/protocol/feature-neg\">
<x xmlns=\"jabber:x:data\" type=\"form\">
<field type=\"list-single\" var=\"stream-method\">
<option>
<value>http://jabber.org/protocol/bytestreams
</value>
</option>
</field>
</x>
</feature>
</si>
</iq>"

But the problem is, how to proceed it further to send this xml to abc@localhost ?

Please help me as soon as possible....

Thanks,
Sreedevi.....
Avatar
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
Use :
XmppClientConnection.Send(yourPacket);
or
XmppClientConnection.IqGrabber.SendIq(iq, new IqCB(SiIqResult), null);

// Callback function
private void SiIqResult(object sender, IQ iq, object data)
{
 // Process the result here
}

but your to attribute is wrong because it's a bare Jid. Normally IQ's are always sent to a FullJid (with some exceptions like vCard).
Software Developer
AG-Software
Avatar
sreedevi1984 #3
Member since Oct 2006 · 38 posts
Group memberships: Members
Show profile · Link to this post
we are using localhost to chat, communicate and to transfer file through psi with abc@localhost id and it is working here for chatting...
Avatar
sreedevi1984 #4
Member since Oct 2006 · 38 posts
Group memberships: Members
Show profile · Link to this post
Now, I am able to transfer the file but the receiver is not able to accept the file and open it... It gives a data transfer error in the receiver's machine....
What may be the cause...?

Please help me..
Avatar
Alex #5
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

abc@localhost works for messages because the server routes this messages to the correct resource automatically. But this does not work for IQ's. You have to semd them to the correct resource.
e.g. abc@localhost/Psi, abc@localhost/Home abc@localhost/Office

Alex
Avatar
sreedevi1984 #6
Member since Oct 2006 · 38 posts
Group memberships: Members
Show profile · Link to this post
Subject: file accepting
Hai,

   Thank you very much for that information. I have corrected it and now I am successful in transferring the file to abc@localhost/Psi .The receiver is getting the request to accept/reject... But when this receiver accepts, he is getting some error.  ".....May be the sender has cancelled..." This sort of error is received there...

What may be its cause..?

I am using JEP65Socket... I am getting the socket.Connected as true..

But dont know what is the problem..
Avatar
Alex #7
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hallo,

i have no idea what's going wrong. You have to debug your code and find the errors. Without logfiles, exceptions etc... we are unable to locate any errors in your code.

Alex
Avatar
sreedevi1984 #8
Member since Oct 2006 · 38 posts
Group memberships: Members
Show profile · Link to this post
This is the debug text which I am getting.... Hope you can find out where is the mistake...

\nSEND:
 <iq xmlns=\"jabber:client\" id=\"agsXMPP_5\" to=\"abc@localhost/Psi\" type=\"set\">
<si xmlns=\"http://jabber.org/protocol/si\" profile=\"http://jabber.org/protocol/si/profile/file-transfer\" id=\"7f117170-da8b-45a9-a36f-73856520d62b\">
<file xmlns=\"http://jabber.org/protocol/si/profile/file-transfer\" name=\"agsxmpp.chm\" size=\"2463170\"><desc>testing...</desc>
<range />
</file>
<feature xmlns=\"http://jabber.org/protocol/feature-neg\">
<x xmlns=\"jabber:x:data\" type=\"form\">
<field type=\"list-single\" var=\"stream-method\">
<option>
<value>http://jabber.org/protocol/bytestreams</value>
</option>
</field>
</x></feature></si></iq>

\nSEND: 

\nSEND:

<iq xmlns=\"jabber:client\" id=\"agsXMPP_6\" to=\"abc@localhost/Psi\" type=\"set\">
<query xmlns=\"http://jabber.org/protocol/bytestreams\" sid=\"7f117170-da8b-45a9-a36f-73856520d62b\">
<streamhost jid=\"sreedevi@localhost/MiniClient\" host=\"192.168.0.12\" port=\"1000\" />
<streamhost jid=\"proxy.ag-software.de\" host=\"proxy.ag-software.de\" port=\"7777\" /></query></iq>

\nSEND:  \nRECV:

<iq xmlns='jabber:client' from='abc@localhost/Psi' id='agsXMPP_6' to='sreedevi@localhost/MiniClient' type='error'>
\n<error code='406'>Not acceptable</error>
\n</iq>

Thank you...
Sreedevi
Avatar
Jabberer #9
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
Hello,

You offer the following streamhosts to the PSI client:

  1. <streamhost jid="sreedevi@localhost/MiniClient" host="192.168.0.12" port="1000"/>
  2. <streamhost jid="proxy.ag-software.de" host="proxy.ag-software.de" port="7777" />

After this you get a error. To me i looks like the PSI can't connect to the streamhosts. I have no idea why. You have to debug your code and check your network configuration, Firewall, NAT etc...

Is there a delay beween sending your streamhosts and the error packet from PSI? Or does PSI send the error packet immediately?
Software Developer
AG-Software
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS