473,513 Members | 2,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sending strings like : "\x01" to web service

Given a web method like this :

[WebMethod]
public string DoEcho(string data)
{
return "echoed <" + data + ">";
}

When this method is called from the client, eg :

string res = service1.DoEcho("\x01");

you get a : System.Xml.XmlException, with message like :

"hexadecimal value 0x01, is an invalid character."

I understand this by design, since chars like 0x01
are not valid XML chars, according to docs like :

http://www.w3.org/TR/REC-xml/#NT-Char

However, just say I still really need to send these sort
of strings around. One possibility is to convert the string
to a byte array, then send as byte array (base64
encoded string by dotent). However, this
seems inefficient.

Has anyone else had this requirement, and found a
good workaround ?

TIA,
Stephen

Nov 12 '05 #1
0 904

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

Similar topics

6
4462
by: José Carlos | last post by:
Hi. How i could compress string of data?. I heart that it´s possible to make with librep, but i´dont know the way to do it. if somebody know any way to do it or any web where explain it i...
3
4484
by: Adam Flott | last post by:
I'm having some difficulty getting the expect function of telnetlib to capture some data that gets returned from a telnet connection. Python's telnet debug reports this: recv...
2
6105
by: dclist | last post by:
What is the correct way to download a file through HTTP and save it to the file name suggested by "Content-Disposition"? I would use urlretrieve but I'm not sure how to obtain the file name...
6
4701
by: zxo102 | last post by:
Hi, how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to "\xED\x6F\x3C\x01" in python coding? When I take 'ED6F3C01' as a string and insert '\x' into it, I just got the error...
0
7257
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,...
0
7157
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...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
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...
0
3232
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...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
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...

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.