sending "\x01" to web service

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default sending "\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 :

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

    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


    Stephen Ahn Guest

  2. Similar Questions and Discussions

    1. [LINUX] cfmx7 saving jvm settings in admin w/ no changesERRs entire cfmx service w/ Jrun "500 null" on service restart.
      Originally, I put this in the GETTING STARTED section but it may be more relevant here??? PLEASE PLEASE take a look and let me know the prognosis ...
    2. cfprocparam sending "???????" to SQL Server
      I have a SQL Server stored procedure that expects an nvarchar parameter. The cfprocparam is sending Russian characters, but the stored proc seems...
    3. Jmail only sending "body" in first run of loop
      I have designed a newsletter that will send any news to my subscribers as soon as it is added to my front page. I have four dynamic bindings which...
    4. Sending "forms" without text?? Please help
      Hi, my knowledge of Flash so far is very basic but I am trying to learn. I would like to know if it's possible to do a screen capture and mail...
    5. Problem sending mail on Server 2003 "SendUsing" configuration is invalid
      Hi, I have a C# asp.net app that sent mail fine on server 2000 or win 2000, but now I moved it to our new 2003 box, and it's giving me "The...
  3. #2

    Default Re: sending "\x01" to web service

    "Stephen Ahn" <noaddress_at_noaddress.com> wrote in news:e5y3ji2gFHA.2472
    @TK2MSFTNGP15.phx.gbl:
    > 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.
    Bytes your best way. If you dont want the base 64 encoding you can look at DIME, etc to alter the
    transport mechanism.


    --
    Chad Z. Hower (a.k.a. Kudzu) - [url]http://www.hower.org/Kudzu/[/url]
    "Programming is an art form that fights back"

    Blog: [url]http://blogs.atozed.com/kudzu[/url]
    Chad Z. Hower aka Kudzu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139