Hi,
The likely issue is that in XML, an end of line is considered white-space.
Each end of an XML processing pair has the option of making their
processors ignore white-space, and I suspect that your choice of trying to
treat multiple records like there were one element is at the root of the
problem.
Have you thought about either using Soap with attachments to transfer the
file in/out, or using a data structure more suitable to passing multiple
records > (e.g. something like this from an on-the-wire perspective?)
<myFile>
<record number="1">the quick brown fox jumped over the lazy dog</record>
<record number="2">every good boy deserves fudge</record>
</myFile>
you could easliy create a class from the following schema fragment that you
would then pass as the input and output type, and you 'd get away from all
of those platform/caller specfic white-space processing rules...
<xs:complexType name="myFile">
<xs:complexContent>
<xs:sequence>
<xs:element name="record" type="xs:string" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
<xs:complexContent>
</xs:complexType>
Throw that in a schema, run it thru XsdObjectGen.exe and you'll have
classes that implement the collection of records. It may not be the file
you had in mind, but a simple file/reader to collection to web call back to
file wrapper is pretty straight forward. Optionally, just make the
resulting XMl the desired file format in the first place, and you can load
the data to be passed as a myFile class type directly in 2 lines.
I hope this helps
Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: Unicode - ASCII ?
thread-index: AcTs/JSY4Pj/8/U2SfGKkqY/YUfuqQ==
X-WBNR-Posting-Host: 208.4.218.82
From: "=?Utf-8?B?Tg==?=" <N@discussions.microsoft.com>
Subject: Unicode - ASCII ?
Date: Tue, 28 Dec 2004 08:45:04 -0800
Lines: 12
Message-ID: <8C**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:8326
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices
Hi,
I'm writing a small web service (using C#) which is going to receive a text
file, add a line to it and send it back.
Input is a string with each line ending with "\r\n".
The problem is in the format of the output - looks like all ends of lines
are missing, even if web service just receives and sends back the same
string.
Could it be some encoding issue?
Thanks in advance!