Carriage Return in WebMethod parameters

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

  1. #1

    Default Carriage Return in WebMethod parameters

    Hi!

    I have this problem. I am sending as a parameter for a
    webmethod a string containing '\r\n' sequences. For some
    reason, when I debug my webmethod, the paramter is
    received with the carriage return characters ('\r')
    stripped. Can someone try this by creating a simple
    webmethod that takes a string as a parameter and returns
    the same string back. On the client, create a proxy, call
    the webmethod and pass: "bla\r\nbla". If you put a bkpoint
    inside the webmethod, you will see the string received
    does not contain '\r' characters.

    [AdvancedDebugging]
    I also created a SOAP extension and verified the message
    that is received on the server in the AfterDeserialize
    stage, and to my surprise, the message contains here the
    carriage return characters.

    I am using the v1.1.4322 Framework on the client and
    server.

    Please HELP!

    :)

    Alin
    Alin Popovici Guest

  2. Similar Questions and Discussions

    1. Mandatory WebMethod parameters
      Hi, I have WebService (C#) with one WebMethod that takes 4 parameters, as below: <s:element minOccurs="0" maxOccurs="1" name="requestedBy"...
    2. Carriage Return
      Please help me how I can enter text with carriage returns into my database. I have a Textbox with TextMode="MultiLine" Now, if inter a text...
    3. How to use own classes as WebMethod-Parameters?
      Is it possible to use self defined classes as parameters for a WebMethod? I thought of the following.... 1. Library-Project: "LibProj" Public...
    4. FTP doesn't add Carriage Return from VMS to NT?
      When I try to use NET::FTP to transfer text files from VMS to NT (GET command using ASCII mode,) FTP will add the Linefeed, but not the required...
    5. outputting a carriage return
      Hi all Can someone tell me why if i echo a line like this: echo "this is a \n newline"; the output is: this is a newline. But if i do...
  3. #2

    Default Re: Carriage Return in WebMethod parameters

    I've experienced this problem too, and it's posted in the newsgroups a few
    time also. The probleem seems to be the \r\n sequence changes when a string
    is serialized to xml and back. The only solution I've seen is to replace the
    carriage return when receiving the parameter with the proper \r\n sequence.

    --
    Greetz

    Jan Tielens
    ________________________________
    Read my weblog: [url]http://weblogs.asp.net/jan[/url]


    "Alin Popovici" <anonymous@discussions.microsoft.com> wrote in message
    news:2a9e01c3d600$f7afbf20$3101280a@phx.gbl...
    > Hi!
    >
    > I have this problem. I am sending as a parameter for a
    > webmethod a string containing '\r\n' sequences. For some
    > reason, when I debug my webmethod, the paramter is
    > received with the carriage return characters ('\r')
    > stripped. Can someone try this by creating a simple
    > webmethod that takes a string as a parameter and returns
    > the same string back. On the client, create a proxy, call
    > the webmethod and pass: "bla\r\nbla". If you put a bkpoint
    > inside the webmethod, you will see the string received
    > does not contain '\r' characters.
    >
    > [AdvancedDebugging]
    > I also created a SOAP extension and verified the message
    > that is received on the server in the AfterDeserialize
    > stage, and to my surprise, the message contains here the
    > carriage return characters.
    >
    > I am using the v1.1.4322 Framework on the client and
    > server.
    >
    > Please HELP!
    >
    > :)
    >
    > Alin

    Jan Tielens 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