Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8384773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:29:34+00:00 2026-06-09T17:29:34+00:00

This is a new question from Getting anwser from Jabber Server You’re not going

  • 0

This is a new question from Getting anwser from Jabber Server

You’re not going to be successful thinking of the XML you receive like
a file, which is where your Unexpected end of file has occurred error
is coming from. You must parse the XML incrementally.

Ok my question is how? How can I send not closed pice of xml?

Should I serializ object and then send?

BTW. I can’t use existing lib because there isn’t at Windows Phone 7.5.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:29:36+00:00Added an answer on June 9, 2026 at 5:29 pm

    Let me elaborate on the explanation with an example (with snippets taken from here).

    You’re not going to be successful thinking of the XML you receive like
    a file, which is where your Unexpected end of file has occurred error
    is coming from. You must parse the XML incrementally.

    When you connect to an XMPP, you open a connection to the server. To do this, you send something like the following…

    <stream:stream
      to='example.com'
      xmlns='jabber:client'
      xmlns:stream='http://etherx.jabber.org/streams'
      version='1.0'>
    

    …let’s ignore authentication for the moment and just assume that this works. You’ll notice that this one section alone is not valid XML (the element is not closed). However, for XMPP, that’s okay. The server will send back it’s own messages to tell you that you’re good to go. Now we know that we can send our message stanzas. We type out our message, then send…

    <message from='juliet@example.com' to='romeo@example.net'>
        <body>Romeo, romeo...</body>
    </message>
    

    After a few seconds, we decide to go offline…

        <presence type='unavailable'/>
    </stream:stream>
    

    Now let’s look at what we sent…

    <stream:stream
          to='example.com'
          xmlns='jabber:client'
          xmlns:stream='http://etherx.jabber.org/streams'
          version='1.0'>
    
        <!-- A few seconds elapsed -->
    
        <message from='juliet@example.com' to='romeo@example.net'>
            <body>Romeo, romeo...</body>
        </message>
    
        <!-- A few seconds elapsed -->
    
        <presence type='unavailable'/>
    </stream:stream>
    

    So, in the end, you can think of the interaction with the server as if you are creating a document that EVENTUALLY becomes a fully valid XML document. And this is a nice way to think about things when you’re first learning about XMPP.

    However, you’re creating this document over a period of time, not all at once. XML libraries typically don’t think that you’re only going to create PART of the document now: they’re concerned with creating the entire document at once. This is why traditional XML libraries may not be helpful for you in writing XMPP programs. Additionally, a simple XML library won’t be able to deal with extra information such as authentication logic.

    In the end, you COULD write your own library. However, you would need to be very careful in your selection of tools (as like I said before, XML libraries might not be able to handle these partial XML creations).

    Anyway, in the end, your question is…

    How can I send not closed pice of xml?

    And the answer is: find a library to do it for you. And I don’t mean just the XML parts: I mean all of XMPP. The right library will not even need you to concern yourself with the fact that XML even exists unless you get really advanced. If you can’t find a library…

    1. Look harder. Spending a day looking for a library is STILL less time than a month making your own.
    2. See if you can find an open-source library that does most of what you want. Then, work around the parts that are different, or make your own source code changes to fill in the gaps.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys. This is a follow-on from this question : After getting the right
I just figured this out but instead of splitting my new question (why?) into
new to this site so sorry if this question is inappropriate, or in the
I'm new and this is my first question. I'm trying to insert a value
I am new on this stuff and this could be a simple question, but
I'm new in this subject so this might be a silly question for most
I'm new to this topic so sorry if this is a stupid question :\
This is a beginner-best-practice question in perl. I'm new to this language. The question
I'm so new to this that I can't even phrase the question right... Anyway,
I searched SO before asking this question, I am completely new to this and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.