473,396 Members | 1,963 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,396 software developers and data experts.

Post and XML issue

Hello,

I am having a problem with a multiline string that I create from a byte
array (xml file). I am using StringBuilder and Ecoding the string to ASCII
(code below).

/ Upload the NameValueCollection.
byte[] responseArray =
myWebClient.UploadValues("https:\\test.com\test.as px","POST",
myNameValueCollection);
// used to build entire input
StringBuilder sb = new StringBuilder();
string tempString = null;
string response = "";
tempString = Encoding.ASCII.GetString(responseArray);
sb.Append(tempString);
response = sb.ToString();

The response still is multi-line with the xml being cut off in elements.
Example:
..... <no
de1/>..... <element1>te
<element1/>

I have tried this code to remove carraige returns, new lines...
response = response.Replace("\r", "").Replace("\t", "").Replace("\n", "");
It removes these characters in the string but leaves the fragmented xml
string. I have also tried UTF8 with no luck and have used Regex too. The
problem is the app I am posting to is returning a formatted xml and when I
convert the byte array to a string the string gets fragmented. I need to
store it
as a string however is there a way to convert the initial byte array into a
xml document? Or do you have an other ideas?

Thanks
Dec 28 '06 #1
0 747

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

Similar topics

0
by: Armin Rigo | last post by:
Post-EuroPython 2005 PyPy Sprint 1st - 7th July 2005 ====================================================== The next PyPy sprint is scheduled right after EuroPython 2005 in Gothenborg, Sweden. ...
8
by: whtevr | last post by:
Consider this HTML on an ASP page called default.asp in a virtual directory: <FORM name="Flogin" id="Flogin" action="" method=post> </FORM> Do I HAVE to put the literal "default.asp" into the...
3
by: Fredrik Kronander | last post by:
Hi, I have an application that let's the user enter text into a textbox and this data is collected on the server and stored in a database. The page is multilingual and sets Response.Charset to...
16
by: Andy Lai | last post by:
Hi, I am writing a C++ program which needs to post an XML to an HTTP server periodically and the program will run on different platforms including w32, linux, and unix. I see that there are...
13
by: kailasam | last post by:
Hello, Iam having a doubt. Which is more efficient post increment or Pre increment? I have read that preincrement is efficient than Post increment. Iam not able to think how it is? For an...
4
by: Duffman | last post by:
Hello, I am working with dynamically created WSDL's and I need to change the transaction urls from http to https in the WSDL without redirecting customers to a different location. (I'm using vs...
8
by: Laith Zraikat | last post by:
I am trying to invoke a post request from code behind of an asp.net page using "WebClient" object, and I want the user to be redirected to the action url as well. So far Ive been able to send...
1
by: pmasclark | last post by:
Hello, I created a web site, site A, that redirects to another web site, site B, where a simple web service is hosted. The code to call the web service is simple. oWS.AllowAutoRedirect = True...
6
by: probashi | last post by:
Hi, Issue: After post back selected item of a list box is getting out of focus (when it contains more items than it's size). I have a List Box in an ASPX page. I select an item from the...
0
by: jumperbl | last post by:
I want to execute the query that this code is generating. I know how to open IE and go a page. But it there a way to go directly to the results page of this form? <form name="test1"...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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...

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.