[JDEV] A report and a dumb question
John Draughn
jdraughn at kiorisoft.com
Sat Oct 6 19:00:12 CDT 2001
You can't use the URLConnection to connect to port 5222. That's
expecting XML streams (see JPG), and http headers would be sent.
-John
On Sat, 2001-10-06 at 18:22, John Bell wrote:
> I think it must be something to do with the URLConnection object in java.net
> and that it is sending some strange header info or something like that
> before I try to write to the connection. I get the error sent back to me
> from jabber.org immediately after connecting, even if I don't send anything.
> Has anyone tried to write a client in Java using the URLConnection object?
> I tried downloading Windump which is a Windows implementation of tcpdump to
> see if I could monitor the information being passed but I can't figure out
> how to use, if anyone has used Windump, I'd appreciate anyhelp.
>
> John.
>
> ----- Original Message -----
> From: "John Bell" <johnbell at telus.net>
> To: <jdev at jabber.org>
> Sent: Saturday, October 06, 2001 11:24 AM
> Subject: Re: [JDEV] A report and a dumb question
>
>
> > > The above was via a "telnet jabber.org 5222" and sending the xml
> > > manually with a \n after the <stream/> tag sent to the server.
> >
> > I'm using an http protocol for the connection. Is it ok to use http? If
> so,
> > do you know the request properties I need to set for the connection? Like
> > the content, or accept properties? I'm using the POST request method.
> >
> > Thanks
> > John.
> >
> > ----- Original Message -----
> > From: "John Draughn" <jdraughn at kiorisoft.com>
> > To: <jdev at jabber.org>
> > Sent: Friday, October 05, 2001 10:55 PM
> > Subject: Re: [JDEV] A report and a dumb question
> >
> >
> > > That appears right, are you sending a '\n' at the end of the <stream/>
> > > tag?
> > >
> > > I sent and received the following to jabber.org:
> > >
> > > <?xml version="1.0" encoding="UTF-8" ?><stream:stream to="jabber.org"
> > > xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
> > > <stream:stream from='jabber.org' id='818329832' xmlns='jabber:client'
> > > xmlns:stream='http://etherx.jabber.org/streams'>
> > >
> > > The above was via a "telnet jabber.org 5222" and sending the xml
> > > manually with a \n after the <stream/> tag sent to the server.
> > >
> > > -zariok-
> > >
> > >
> > > On Sat, 2001-10-06 at 00:15, John Bell wrote:
> > > > New to jabber,
> > > > I just tried to post a question on the "client development" forum on
> > jabber.org since it's a real novice question and that's the right place
> for
> > that. In the message I posted some xml that was giving me a bit of a
> > problem, but it seems the server isn't encoding the messages, converting
> "<"
> > with "<" so all my code samples got eaten up by the server and
> dissapeared
> > from the message text. I think it would be a good enhancement to the
> server,
> > to encode the message text.
> > > > So I've come this far, I may as well ask my dumb question here, I know
> > this is not the right place but I hope you'll excuse me:
> > > >
> > > > I'm writing a client in Java on Win2000, and I can't seem to be able
> the
> > initialize the connection to jabber.org. Using the Java URLConnection
> object
> > and JAXP 1.1 DefaultHandler for the parser. I send the following
> > initialization on the output stream:
> > > >
> > > > <?xml version="1.0" encoding="UTF-8" ?><stream:stream to="jabber.org"
> > xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">
> > > >
> > > > I get the following error set back from the server in the
> <stream:error>
> > tag:
> > > >
> > > > Invalid XML received; connection closed.
> > > >
> > > > Is the "to:" line correct for the jabber.org server? Any other ideas?
> > > >
> > > > Thanks
> > >
> > >
> > > _______________________________________________
> > > jdev mailing list
> > > jdev at jabber.org
> > > http://mailman.jabber.org/listinfo/jdev
> > >
> >
> > _______________________________________________
> > jdev mailing list
> > jdev at jabber.org
> > http://mailman.jabber.org/listinfo/jdev
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
More information about the JDev
mailing list