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 6173643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:36:42+00:00 2026-05-23T23:36:42+00:00

I am trying to implement a protocol which I will use for my application

  • 0

I am trying to implement a protocol which I will use for my application to communicate with a server. The problem is that the server is using XML so I tried to send a string to the server containing xml but I get only errors.

When I send this :

mymsg: String = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+
'<m:outgoingEngineMessage xmlns:c="http://www.bvb.ro/xml/ns/arena/gw/constraints"'+
'xmlns:m="http://www.bvb.ro/xml/ns/arena/gw/msg"'+
'xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;'+
'&lt;content xsi:type=&quot;HeartBeatcmd&quot;&gt;'+
'&lt;/content&gt;'+
'&lt;csq&gt;100212&lt;/csq&gt;'+
'&lt;/m:outgoingEngineMessage&gt;';

I receive an error saying:

Element type “m:outgoingEngineMessage” must be followed by either
attribute specifications, “&gt ;” or “/&gt ;”

When I send this:

mymsg : String = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+
    '&lt;m:outgoingEngineMessage xmlns:c=&quot;http://www.bvb.ro/xml/ns/arena/gw/constraints"'+
    'xmlns:m="http://www.bvb.ro/xml/ns/arena/gw/msg"'+
    'xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;'+
    '&lt;content xsi:type=&quot;HeartBeatcmd&quot;&gt;'+
    '&lt;/content&gt;'+
    '&lt;csq&gt;100212&lt;/csq&gt;'+
    '&lt;/m:outgoingEngineMessage&gt;'

I get: Element not allowed in prolog…

Can some one enlighten me what I am doing wrong? I have never worked with xml files before. Is there a function to convert xml to utf8 correctly? please explain.

  • 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-05-23T23:36:44+00:00Added an answer on May 23, 2026 at 11:36 pm

    You also need to put a space at the end of each line where the line break is between attributes. You are in effect jamming them all together:

    <m:outgoingEngineMessage xmlns:c="http://www.bvb.ro/xml/ns/arena/gw/constraints"'+
    'xmlns:m="http://www.bvb.ro/xml/ns/arena/gw/msg"'+
    'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'
    

    will produce:

    <m:outgoingEngineMessage xmlns:c="http://www.bvb.ro/xml/ns/arena/gw/constraints"xmlns:m="http://www.bvb.ro/xml/ns/arena/gw/msg"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    

    To fix this, you need to do something like the following (based on @The_Fox’s code):

    mymsg: String = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+
    '<m:outgoingEngineMessage xmlns:c="http://www.bvb.ro/xml/ns/arena/gw/constraints" '+
    //                                                          see the space here --^
    'xmlns:m="http://www.bvb.ro/xml/ns/arena/gw/msg" '+
    //                                   and here --^
    'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'+
    '<content xsi:type="HeartBeatcmd">'+
    '</content>'+
    '<csq>100212</csq>'+
    '</m:outgoingEngineMessage>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement a function called inet_pton which will convert a string
I'm trying to implement a simple FTP server (a variation of the EFTP protocol)
trying to implement a dialog-box style behaviour using a separate div section with all
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
We are trying to implement a REST API for an application we have now.
I am trying to implement AJAX in my Google App Engine application, and so
I'm developing an iPhone application which uses a TableView to display XML data. The
I am trying to implement a REST protocol and have realized in trying to
I am trying to implement PayPal IPN functionality. The basic protocol is as such:
I am trying to implement google authentication on my site using the google federated

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.