By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,899 Members | 1,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,899 IT Pros & Developers. It's quick & easy.

XML seralization & hexadecimal values

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a

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***@nsmanagedenlighten.co.nz>
| 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.public.dotnet.languages.csharp
| NNTP-Posting-Host: pop11-port30.jetstart.maxnet.co.nz 202.89.56.30
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:187448
| X-Tomcat-NG: microsoft.public.dotnet.languages.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

P: n/a
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.microsoft.com> wrote in message
news:f6**************@cpmsftngxa06.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***@nsmanagedenlighten.co.nz>
| 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.public.dotnet.languages.csharp
| NNTP-Posting-Host: pop11-port30.jetstart.maxnet.co.nz 202.89.56.30
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:187448 | X-Tomcat-NG: microsoft.public.dotnet.languages.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

P: n/a
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***@nsmanagedenlighten.co.nz>
!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.public.dotnet.languages.csharp
!NNTP-Posting-Host: ip-218-101-56-3.adsl.concept.net.nz 218.101.56.3
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:188273
!X-Tomcat-NG: microsoft.public.dotnet.languages.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.microsoft.com> wrote in message
!news:f6**************@cpmsftngxa06.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***@nsmanagedenlighten.co.nz>
!> | 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.public.dotnet.languages.csharp
!> | NNTP-Posting-Host: pop11-port30.jetstart.maxnet.co.nz 202.89.56.30
!> | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
!> | Xref: cpmsftngxa06.phx.gbl
!microsoft.public.dotnet.languages.csharp:187448
!> | X-Tomcat-NG: microsoft.public.dotnet.languages.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

P: n/a

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**************@cpmsftngxa06.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***@nsmanagedenlighten.co.nz>
!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.public.dotnet.languages.csharp
!NNTP-Posting-Host: ip-218-101-56-3.adsl.concept.net.nz 218.101.56.3
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:188273 !X-Tomcat-NG: microsoft.public.dotnet.languages.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.microsoft.com> wrote in message
!news:f6**************@cpmsftngxa06.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***@nsmanagedenlighten.co.nz>
!> | 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.public.dotnet.languages.csharp
!> | NNTP-Posting-Host: pop11-port30.jetstart.maxnet.co.nz 202.89.56.30
!> | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
!> | Xref: cpmsftngxa06.phx.gbl
!microsoft.public.dotnet.languages.csharp:187448
!> | X-Tomcat-NG: microsoft.public.dotnet.languages.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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.