JohnKenVan / jabber-net

Automatically exported from code.google.com/p/jabber-net
Other
0 stars 0 forks source link

In-band registration #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using jabber-net with provided c# client example.
This is the output

SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams"
id="a8fe7fa2" xmlns="jabber:client" to="localhost" version="1.0">
New state: jabber.connection.NonSASLAuthState
New state: jabber.client.GetAuthState
RECV: <?xml version='1.0' encoding='UTF-8' ?><stream:stream
xmlns='jabber:client' from='localhost' id='5C39D4'
xmlns:stream='http://etherx.jabber.org/streams'>
SEND: <iq id="JN_1" type="get"><query
xmlns="jabber:iq:auth"><username>test</username></query></iq>
RECV: <iq id='JN_1' type='error'>
<query xmlns='jabber:iq:auth' type='error'>
<error code='404'>
User not found
</error>
</query>
</iq>
SEND: <iq id="JN_2" type="get" to="localhost"><query
xmlns="jabber:iq:register"><username>test</username></query></iq>
RECV: <iq from='localhost' type='result' id='JN_2'>
<username/>
<password/>
<hash/>
</iq>
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----

---- Assert Long Message ----

    at JabberClient.OnGetRegister(Object sender, IQ iq, Object data) 
D:\VS.NET\JabberSolutions\Jabber-Net\jabber\client\JabberClient.cs(598)
    at IQTracker.OnIQ(Object sender, XmlElement elem) 
D:\VS.NET\JabberSolutions\Jabber-Net\jabber\connection\IQTracker.cs(87)
    at RuntimeMethodHandle._InvokeMethodFast(Object target, Object[]
arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)  
    at RuntimeMethodHandle.InvokeMethodFast(Object target, Object[]
arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)  
    at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder
binder, Object[] parameters, CultureInfo culture, Boolean
skipVisibilityChecks)  
    at Delegate.DynamicInvokeImpl(Object[] args)  
    at Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)  
    at Control.InvokeMarshaledCallbackHelper(Object obj)  
    at ExecutionContext.runTryCode(Object userData)  
    at RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code,
CleanupCode backoutCode, Object userData)  
    at ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state)  
    at ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)  
    at Control.InvokeMarshaledCallback(ThreadMethodEntry tme)  
    at Control.InvokeMarshaledCallbacks()  
    at Control.WndProc(Message& m)  
    at ScrollableControl.WndProc(Message& m)  
    at ContainerControl.WndProc(Message& m)  
    at Form.WndProc(Message& m)  
    at ControlNativeWindow.OnMessage(Message& m)  
    at ControlNativeWindow.WndProc(Message& m)  
    at NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr
wparam, IntPtr lparam)  
    at UnsafeNativeMethods.DispatchMessageW(MSG& msg)  
    at
ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.F
PushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)  
    at ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext
context)  
    at ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)  
    at Application.Run(Form mainForm)  
    at MainForm.Main()  \Jabber-Net\Example\MainForm.cs(602)

Original issue reported on code.google.com by chiod...@gmail.com on 15 Jan 2008 at 10:19

GoogleCodeExporter commented 8 years ago
Agree that it shouldn't be an assert, but should fire a BadProtocol exception.  
The IQ you are getting from 
your server is really wrong.  It should look like this:

<iq from='localhost' type='result' id='JN_2'>
  <query xmlns="jabber:iq:register">
    <username/>
    <password/>
    <hash/>
  </query>
</iq>

Original comment by hil...@gmail.com on 15 Jan 2008 at 3:02

GoogleCodeExporter commented 8 years ago
sorry. i'm new to xmpp and I couldn't see the missing <query> element in my 
server
response. may be a BadProtocol expcetion could help newbie to understand what's 
wrong

thank you for help

Original comment by chiod...@gmail.com on 15 Jan 2008 at 4:07

GoogleCodeExporter commented 8 years ago
OK, it now throws a BadProtocol exception.  I've also reworked registration 
pretty thoroughly, so that it can now 
do UI stuff.  The example program shows how to pop up a x:data form.

Original comment by hil...@gmail.com on 15 Jan 2008 at 7:14