473,602 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML seralization & hexadecimal values

I'm getting '', hexadecimal value 0x02, is an invalid character when I'm
deseralizing XML from a 3rd party XML gateway. How do I get rid of these
hexadecimal values before I deserialize?

Cheers

Damon
Nov 15 '05 #1
5 7897

Hi Damon,

How does your xml file serialized?
Is it also serialized by this 3rd part component?
If it is, why it can not deserialize, I think it may be the problem of the
3rd part component.

As a workaround, may be you can use IO operation to open this xml
file and get all the content, then delete the '' characters store it as a
new xml file.

You can try to deserialize this new file to see if it works.

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Damon" <da***@nsmanage denlighten.co.n z>
| Subject: XML seralization & hexadecimal values
| Date: Fri, 26 Sep 2003 13:13:01 +1200
| Lines: 9
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OU************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: pop11-port30.jetstart .maxnet.co.nz 202.89.56.30
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1874 48
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| I'm getting '', hexadecimal value 0x02, is an invalid character when I'm
| deseralizing XML from a 3rd party XML gateway. How do I get rid of these
| hexadecimal values before I deserialize?
|
| Cheers
|
| Damon
|
|
|

Nov 15 '05 #2
I've found out the reason why these hexadecimal values are coming up in the
XML request. It is because the request is GSM encoded as its an XML gateway
for sending and receiving SMS messages.

This means that letters such as a-z come through fine but characters such as
$ which is 2 in the GSM character set throws the below error.

What I'm not sure on is how to do the conversion to and from GSM. I'm
getting the response back from the other server using a StreamReader which
defaults to UTF8 encoding.

In order to do this conversion will I need to create my own encoding object
and then change the encoding type on the StreamReader to be something like
GSMEncoding or is there another way?

Cheers

Damon

"Jeffrey Tan[MSFT]" <v-*****@online.mi crosoft.com> wrote in message
news:f6******** ******@cpmsftng xa06.phx.gbl...

Hi Damon,

How does your xml file serialized?
Is it also serialized by this 3rd part component?
If it is, why it can not deserialize, I think it may be the problem of the
3rd part component.

As a workaround, may be you can use IO operation to open this xml
file and get all the content, then delete the '' characters store it as a
new xml file.

You can try to deserialize this new file to see if it works.

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Damon" <da***@nsmanage denlighten.co.n z>
| Subject: XML seralization & hexadecimal values
| Date: Fri, 26 Sep 2003 13:13:01 +1200
| Lines: 9
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OU************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: pop11-port30.jetstart .maxnet.co.nz 202.89.56.30
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1874 48 | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| I'm getting '', hexadecimal value 0x02, is an invalid character when I'm | deseralizing XML from a 3rd party XML gateway. How do I get rid of these
| hexadecimal values before I deserialize?
|
| Cheers
|
| Damon
|
|
|

Nov 15 '05 #3
Hello Damon,

Thanks for the detailed description.

Based on my understanding, now the XML gateway sends and receiveds the data
by usign GSM encoding. So the '' is '$' after the encoding. Please post
here if I have misunderstood anything.

If the GSM character set doesn't inlcude '$', I think we need to transfer
it manually. That is to say, we need to create a customized class to encode
the xml string before transferring it to GSM gateway. Then decoding work
should also be done by ourselves.

We are not sure of if there is any setting in GSM gateway side to avoid it.
You need to post in their group for more information. It is very possible
that they have existing encoding class already.

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: "Damon" <da***@nsmanage denlighten.co.n z>
!References: <OU************ **@tk2msftngp13 .phx.gbl>
<f6************ **@cpmsftngxa06 .phx.gbl>
!Subject: Re: XML seralization & hexadecimal values
!Date: Wed, 1 Oct 2003 10:46:39 +1200
!Lines: 73
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <Of************ **@TK2MSFTNGP09 .phx.gbl>
!Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
!NNTP-Posting-Host: ip-218-101-56-3.adsl.concept. net.nz 218.101.56.3
!Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
!Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1882 73
!X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
!
!I've found out the reason why these hexadecimal values are coming up in the
!XML request. It is because the request is GSM encoded as its an XML gateway
!for sending and receiving SMS messages.
!
!This means that letters such as a-z come through fine but characters such
as
!$ which is 2 in the GSM character set throws the below error.
!
!What I'm not sure on is how to do the conversion to and from GSM. I'm
!getting the response back from the other server using a StreamReader which
!defaults to UTF8 encoding.
!
!In order to do this conversion will I need to create my own encoding object
!and then change the encoding type on the StreamReader to be something like
!GSMEncoding or is there another way?
!
!Cheers
!
!Damon
!
!"Jeffrey Tan[MSFT]" <v-*****@online.mi crosoft.com> wrote in message
!news:f6******* *******@cpmsftn gxa06.phx.gbl.. .
!>
!> Hi Damon,
!>
!> How does your xml file serialized?
!> Is it also serialized by this 3rd part component?
!> If it is, why it can not deserialize, I think it may be the problem of
the
!> 3rd part component.
!>
!> As a workaround, may be you can use IO operation to open this xml
!> file and get all the content, then delete the '' characters store it as
a
!> new xml file.
!>
!> You can try to deserialize this new file to see if it works.
!>
!> Hope this helps,
!> Best regards,
!> Jeffrey Tan
!> Microsoft Online Partner Support
!> Get Secure! - www.microsoft.com/security
!> This posting is provided "as is" with no warranties and confers no
rights.
!>
!> --------------------
!> | From: "Damon" <da***@nsmanage denlighten.co.n z>
!> | Subject: XML seralization & hexadecimal values
!> | Date: Fri, 26 Sep 2003 13:13:01 +1200
!> | Lines: 9
!> | X-Priority: 3
!> | X-MSMail-Priority: Normal
!> | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!> | Message-ID: <OU************ **@tk2msftngp13 .phx.gbl>
!> | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
!> | NNTP-Posting-Host: pop11-port30.jetstart .maxnet.co.nz 202.89.56.30
!> | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
!> | Xref: cpmsftngxa06.ph x.gbl
!microsoft.publ ic.dotnet.langu ages.csharp:187 448
!> | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
!> |
!> | I'm getting '', hexadecimal value 0x02, is an invalid character when
!I'm
!> | deseralizing XML from a 3rd party XML gateway. How do I get rid of
these
!> | hexadecimal values before I deserialize?
!> |
!> | Cheers
!> |
!> | Damon
!> |
!> |
!> |
!>
!
!
!

Nov 15 '05 #4

Hi Yanhong,

You are correct about how the GSM encoding works.

I have created a GSMEncoding object however from what I have found the
message is not always GSM encoded. I need to perform some more tests to try
and find out what is happening and the service providers is not sure
themselves.

I have a test system being set-up in the next couple of days so I will reply
with my findings then.

Cheers

Damon
"Yan-Hong Huang[MSFT]" <yh*****@online .microsoft.com> wrote in message
news:CH******** ******@cpmsftng xa06.phx.gbl...
Hello Damon,

Thanks for the detailed description.

Based on my understanding, now the XML gateway sends and receiveds the data by usign GSM encoding. So the '' is '$' after the encoding. Please post
here if I have misunderstood anything.

If the GSM character set doesn't inlcude '$', I think we need to transfer
it manually. That is to say, we need to create a customized class to encode the xml string before transferring it to GSM gateway. Then decoding work
should also be done by ourselves.

We are not sure of if there is any setting in GSM gateway side to avoid it. You need to post in their group for more information. It is very possible
that they have existing encoding class already.

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!From: "Damon" <da***@nsmanage denlighten.co.n z>
!References: <OU************ **@tk2msftngp13 .phx.gbl>
<f6************ **@cpmsftngxa06 .phx.gbl>
!Subject: Re: XML seralization & hexadecimal values
!Date: Wed, 1 Oct 2003 10:46:39 +1200
!Lines: 73
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <Of************ **@TK2MSFTNGP09 .phx.gbl>
!Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
!NNTP-Posting-Host: ip-218-101-56-3.adsl.concept. net.nz 218.101.56.3
!Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
!Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1882 73 !X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
!
!I've found out the reason why these hexadecimal values are coming up in the !XML request. It is because the request is GSM encoded as its an XML gateway !for sending and receiving SMS messages.
!
!This means that letters such as a-z come through fine but characters such
as
!$ which is 2 in the GSM character set throws the below error.
!
!What I'm not sure on is how to do the conversion to and from GSM. I'm
!getting the response back from the other server using a StreamReader which !defaults to UTF8 encoding.
!
!In order to do this conversion will I need to create my own encoding object !and then change the encoding type on the StreamReader to be something like !GSMEncoding or is there another way?
!
!Cheers
!
!Damon
!
!"Jeffrey Tan[MSFT]" <v-*****@online.mi crosoft.com> wrote in message
!news:f6******* *******@cpmsftn gxa06.phx.gbl.. .
!>
!> Hi Damon,
!>
!> How does your xml file serialized?
!> Is it also serialized by this 3rd part component?
!> If it is, why it can not deserialize, I think it may be the problem of
the
!> 3rd part component.
!>
!> As a workaround, may be you can use IO operation to open this xml
!> file and get all the content, then delete the '' characters store it as a
!> new xml file.
!>
!> You can try to deserialize this new file to see if it works.
!>
!> Hope this helps,
!> Best regards,
!> Jeffrey Tan
!> Microsoft Online Partner Support
!> Get Secure! - www.microsoft.com/security
!> This posting is provided "as is" with no warranties and confers no
rights.
!>
!> --------------------
!> | From: "Damon" <da***@nsmanage denlighten.co.n z>
!> | Subject: XML seralization & hexadecimal values
!> | Date: Fri, 26 Sep 2003 13:13:01 +1200
!> | Lines: 9
!> | X-Priority: 3
!> | X-MSMail-Priority: Normal
!> | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!> | Message-ID: <OU************ **@tk2msftngp13 .phx.gbl>
!> | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
!> | NNTP-Posting-Host: pop11-port30.jetstart .maxnet.co.nz 202.89.56.30
!> | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
!> | Xref: cpmsftngxa06.ph x.gbl
!microsoft.publ ic.dotnet.langu ages.csharp:187 448
!> | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
!> |
!> | I'm getting '', hexadecimal value 0x02, is an invalid character when
!I'm
!> | deseralizing XML from a 3rd party XML gateway. How do I get rid of
these
!> | hexadecimal values before I deserialize?
!> |
!> | Cheers
!> |
!> | Damon
!> |
!> |
!> |
!>
!
!
!

Nov 15 '05 #5
Hi Damon,

Great. I look forward to the testing result. Please feel free to post here
for further discussion. :)

Thanks.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9242
by: Bill Parker | last post by:
Hi Is there a way to generate colour hex strings that are guaranteed to be dark and thus good as random-generated text colours? something like ------------------- srand((double)microtime()*1000000); function tc() {
1
2736
by: Francesc Guim Bernat | last post by:
Dear colleagues, i'm getting in troubles using one XML library with Visual Studio .NET and Xerces with Xalan. When i execute the code i get the next run time error: "Run-Time Check Failure #2 - Stack around the variable 'resolver' was corrupted." Looking on internet i've seen that the compiler, if you're running your
1
1844
by: User Axes Dean Eyed | last post by:
The following statement does not yield what I expect it to: var txtNode = document.createTextNode("ESI&minus;"); txtNode holds a value of "ESI&minus;" instead of "ESI-" where '-' is the character entity reference for the minus sign, that I expect. I have tried other variations. I am working with Mozilla and IE because I want to make NO use of extensions/browser-dependent code, and both (try to) implement the DOM to varying degrees.
2
8446
by: Damon | last post by:
I'm getting errors using XML deserialisation and CDATA sections when there are hexidecimal characters involved. If the CDATA section does not contain a hexidecimal values everything is fine. However if I have a hexidecimal value in the CDATA section the parser throws errors when it hits the hex character. I thought CDATA sections are meant to be ignore by the parser? Can anyone shed some light on this for me. The error is below:
5
2607
by: Alisa | last post by:
How can i get the seralization of an object as string? Can i avoid saving a temporary file? thanks
6
22495
by: Hong Kong Phooey | last post by:
I feel dumb asking this, haveing programmed in VB for so long, but here goes... What is the rule for putting an ampersand (&) at the END of a hexadecimal number in VB? For example: Dim x As Integer Dim y As Integer Dim z As Integer
1
2870
by: Fernando Barsoba | last post by:
Hi all, First of all, I'd like to thank you "Skarmander" and "Flash Gordon" for the help they provided me: Skarmander's algorithm and Flash's modifications helped me a lot. Here's the problem I had and the question which I still have regarding that problem: I tried to send a hex string to a function that performed message
12
2207
by: arnuld | last post by:
this is exercise 2-3 from the mentioned section. i have created a solution for it but i see errors and i tried to correct them but still they are there and mostly are out of my head: ------------------------------- PROGRAMME -------------------------- /* Section 2.7 type conversions we are asked to write a function "htoi(an array)" that accomplishes this:
11
3347
by: sweeet_addiction16 | last post by:
hello im programming in c.i have to write about 100 hexadecimal values in to a file. how do i do it?pls help me
0
7993
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3900
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.