473,326 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

HTTP Response - Eliminating Whitespace

Hi

I've got an unusual problem I'm hoping someone could advise me on, regarding
the formatting of the body of an HTTP response from a web service.

We are using HTTP POST rather than SOAP for calling web methods to save
network traffic over a cellular network. Each web method returns an
XmlDocument with a <resproot element. Most web methods simply return a
single value as the content of the <respelement (integer or string).
However one returns multiple XML elements within the <resproot. This is
the one we are having problems with.

Checking the output of the web method using Etherreal I found that the text
of XML document in the HTTP response is being formatted with added white
spaces. In the body of the HTTP response each XML tag is followed by a
carriage return-line feed and prefixed by a varying number of spaces to
indent it (number of spaces depends on the tag's level in the XML hierarchy).

Debugging the web method code I put a break point on the line that returns
the XML document and converted the XML document to a character array. The
character array showed none of the carriage return - line feeds nor the
indenting spaces. From this I assume the formatting is being applied in one
of three places:
1) In the web service, under the hood where I'm not aware of what's going on;
2) By the IIS server the web service is running on;
3) Due to the settings in the HTTP headers in either the POST or the response.

Has anyone any idea of what might be adding the white space formatting to
the XML document in the HTTP response and what I might do to get rid of it?

The web service is written in ASP.NET 2.0 (C#) running on an IIS 6.0 web
server on Windows Server 2003.

The HTTP Header of the request is (as captured by Etherreal):
POST /mrcourier/Config/ConfigWS.asmx/GetBCMs HTTP/1.1\r\n
Content-Type: application/x-www-form-urlencoded\r\n
Host: <server name>\r\n
Content-Length: 27\r\n
Expect: 100-continue\r\n
Connection: Keep-Alive\r\n
\r\n

the HTTP header of the response is:
HTTP/1.1 200 OK\r\n
Date: Sun, 27 Aug 2006 23:37:49 GMT\r\n
Server: Microsoft-IIS/6.0\r\n
X-AspNet-Version: 2.0.50727\r\n
Cache-Control: private, max-age=0\r\n
Content-Type: text/xml; charset=utf-8\r\n
Content-Length: 351\r\n
\r\n

Cheers
Simon

--
Si
Aug 28 '06 #1
0 1344

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

Similar topics

9
by: Thomas Mlynarczyk | last post by:
Which is the simplest way to remove all whitespace from a string? Is there a simpler method than a regex replace? Or how can I tell a regex pattern to ignore all whitespace in my subject string?...
2
by: Wolfgang Jeltsch | last post by:
Hello, it is often convenient to insert whitespace into an XML document in order to format it nicely. For example, take this snippet of a notional DocBook XML document: <para> This is a...
0
by: Shan Plourde | last post by:
Hi everyone, I have been using various regular expressions with the ASP.NET RegularExpressionValidator for quite some time. In general it works very well. One of the common regex's that I use...
3
by: David Pratt | last post by:
Hi. I am splitting a string on a non whitespace character. One or more whitespace characters can be returned as items in the list. I do not want the items in the list that are only whitespace (can...
9
by: amattie | last post by:
Does anyone have any idea on how I can strip the extra whitespace in the XML that shows up when I receive a response from an ASP.NET 2.0 webservice? This has been discussed before, but no one has...
1
by: John Braham | last post by:
I have a slight wall headbutter which I'm hoping someone will have an idea for (I'd be very grateful!). Basically I'm trying to make a form post to an asp page programatically from within VB.NET...
5
jamesd0142
by: jamesd0142 | last post by:
My manager and I where looking at some complex code to eliminate duplicate records in a database table. then it hit me how its done easily... so i thought i'd share it... In English:...
5
by: John Gordon | last post by:
My XSLT files have many occurrences of this general pattern: <a> <xsl:attribute name="href"> <xsl:value-of select="xyz" /> </xsl:attribute> </a> When I execute an XSL transform, the...
13
by: Chaim Krause | last post by:
I am unable to figure out why the first two statements work as I expect them to and the next two do not. Namely, the first two spit the sentence into its component words, while the latter two...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.