submitting an XML file to a server, saving the file on the server and reposting the data to another url

I apologize in posting what is quite likely obvious to many - I kept looking in the forums but could' nt find a parallel - please point me in the right direction.

1. I need to upload an XML file to a server ( This is sort of complete)

The code that has been used is

<%

Set xmlDoc = CreateObject("Msxml2.DOMDocument.5.0")

Set xmlHTTP = CreateObject("MSXML2.ServerXMLHTTP.5.0")

xmlDoc.validateOnParse = True

xmlDoc.async = False

xmlDoc.load("C:\Inetpub\wwwroot\test\PO.XML")

xmlHTTP.open ("POST", "http://www.something.com/OrderRequest.aspx", False)

xmlHTTP.send(xmlDoc)

Response.write xmlHTTP.responseText

%>

2. On the server I need to

  1. save the file on the server  -  I know how to do this
  2. parse the xml file for some tags  - know how to do this
  3. connect to another server and present a certificate
  4. post the same xml file to the other server

Once again I suspect this is all very obvious to most people here but I am completely new to ASP.Net in fact to Microsoft technologies

 

Thank you

0
newcoder1000
4/9/2008 3:47:56 PM
asp.net.xml-datasource 7181 articles. 0 followers. Follow

2 Replies
1093 Views

Similar Articles

[PageSpeed] 21
Get it on Google Play
Get it on Apple App Store

Hi newcoder1000 ,

How to submitting an xml file to server :

http://www.asp.net/learn/data-access/tutorial-54-cs.aspx

How to post the data to another url:

First you need to use Class XmlDocument to load the xml file. Then you can invoke it's OuterXml property to get xml data.

Finally, you can use code below to send the data to another url.

 

            string url = "http://localhost:20478/abc.aspx";
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);

            string s = "xmldata";
            byte[] requestBytes = System.Text.Encoding.ASCII.GetBytes(s);
            req.Method = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            req.ContentLength = requestBytes.Length;
            Stream requestStream = req.GetRequestStream();
            requestStream.Write(requestBytes, 0, requestBytes.Length);
            requestStream.Close();




            HttpWebResponse res = (HttpWebResponse)req.GetResponse();
            StreamReader sr = new StreamReader(res.GetResponseStream(), System.Text.Encoding.Default);
            string backstr = sr.ReadToEnd();
            Response.Write(backstr);
            sr.Close();
            res.Close();
 

Samu Zhang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
Samu
4/11/2008 9:43:44 AM

Thank you so much!

0
newcoder1000
4/14/2008 1:44:51 PM
Reply:

Similar Artilces:

submitting an XMl file to a server, saving it as an XML file and reposting it to another url
I apologize in posting this - I kept looking in the forums but could' nt find a parallel - please point me in the right direction. 1. I need to upload an XML file to a server ( This is sort of complete) The code that has been used is <% Set xmlDoc = CreateObject("Msxml2.DOMDocument.5.0") Set xmlHTTP = CreateObject("MSXML2.ServerXMLHTTP.5.0") xmlDoc.validateOnParse = True xmlDoc.async = False xmlDoc.load("C:\Inetpub\wwwroot\test\PO.XML") xmlHTTP.open ("POST", "http://www.something.com/OrderRequest.aspx", False) xmlHTTP.send(x...

Select XML Data type (xml) from sql server 2005 and then save to a XML file on local machine?? Help !
Hi All  I have a problem i am selecting a row of data from a database, within that row is a column in which i build up a xml in a stored procedure, it creates an xml and stores it in the column name xmldata which is of xml datatype. This works great My problem is how do i now create a xml file on my local machine with that data, below is what i have so far :- Dim conn1 As New SqlConnection()conn1.ConnectionString = (ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString) conn1.Open()Dim DBCmd As New SqlCommand Dim DataRecieved As SqlDataReaderDBCmd...

Save xml file from a URL (load xml file from a URL) [Edit]
Hello friends, I need to save an xml file from a URL. Follow the URL https://mcxnow.com/orders?cur=MCX Please help me. Thank you, Thiago Thiago wrote: > I need to save an xml file from a link. Follow the link > https://mcxnow.com/orders?cur=MCX Please help me. The correct term is URL, not link. Have a look at Indy's TIdHTTP component. For example: {code} MS := TMemoryStream.Create; try // when requesting an HTTPS url, you need to first assign an // SSL IOHandler component, such as TIdSSLIOHandlerSocketOpenSSL, // to the TIdHTTP.IOHandler prope...

XML Transform to 1 XML file to another XML File
Hello All  I am a novice programmer. I want to transform 1 xml file to another xml file. I am looking for a example code where user will select source xml file and create another xml file in different file with different fields with some default validation of parsing date and default values.  Can anyone help me or let me know any available source code in C#/ASP.Net?  Ms Disha I am assuming you know xslt, if not, you would have to go look at that.  But if you do, then this document will help you out http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=...

How do I Insert Data from an XML file to an SQL Server 2005 XML column
Hi All, I have an XML file that I want to insert into an Sql Server 2005 XML column. I need a new row for each parent node. ie: row 1 <site><data></data></site> row 2 <site><data></data></site> I'm using a Stored Procedure. Any guidence is appriciated. Regards MalMalcolm HornsbyBurleigh Waters Qld 4220Australia  check out this link : http://www.freevbcode.com/ShowCode.Asp?ID=2789 Please Mark as Answred If This Blog has Helped You.RegardsMitesh Darjihttp://www.indianic.comhttp://www.mitatdotnet.blogspot.com  Do y...

Create an XML file from another XML file
I am using VS 2005 with C#.  I would like to create/generate an xml file from another XML with a differnt structure.  Basically, I want to create the actual xml file for my users whenever they raise my web service method. This is the actual structure of my xml i would like to create the following <Education>  <mydata>    <year>1988 - 1995</year>    <reward>High School Diploma</reward>    <school>Miami Secondary</school>  </mydata>  ...</Education> The original ...

How to send xml file or data to a server and save it locally?
Hi folk... and thanks for reading this   I have an Xml file that I need to send or upload from my Windows Application, to a server we have on the other side using asp.net application running on the server!     I know that its possible to use HttpWebRequest to post the data of my file to another ASP.Net App. working on the server side, so I made this code:   string result   = ""; // postData is an Xml Data from the file 1.xml string postData = GetDataFromXmlFile(“1.xml”); string url = http://localhost/MyApsNetWebApp/WebForm1.aspx;   HttpWebReque...

Microsoft Chart control for .NET Framework about state management and serialization problem, it works OK with one XML file but fails with another XML file
I use Microsoft Chart control for .NET Framework , you can see details at http://blogs.msdn.com/alexgor/archive/2008/10/27/microsoft-chart-control-for-net-framework-released.aspx The Chart1 is load data from a xml and save to ViewStateData, so even if after I click Reload button, the chart1 still display OK! I'm very strange that the chart1 works well after click Reload button if it's loaded from Chart1.Serializer.Load(HttpContext.Current.Server.MapPath("~/Template/1.xml"));but chart1 don't display fter click Reload button if it's loaded from Chart1.Serializer.Loa...

how to save file (stored on SQL server) to file/web server?
Hi Experts, I got files stored on SQL server db. I would like to be able to save them onto file/web server. I know how to retrieve them, but not sure how to save to file/web server. Please help. Thanks so much. Below are codes for retrieving file info from sql server:Dim strFileName As String = Quote.GetQuoteFileByQuoteFileID(CInt(selectedQuoteFileID)).Tables(0).Rows(0).Item("QuoteFileName")Dim strFileType As String = Quote.GetQuoteFileByQuoteFileID(CInt(selectedQuoteFileID)).Tables(0).Rows(0).Item("QuoteFileType")Dim strFileSize As Integer = Quote.GetQuoteFileByQuoteFileID(CInt(selectedQ...

transform one xml file into xml file with another format?
 I want to transform one xml file into xml file with another format, can I use xslt to realize it? Please give me one good sample.Thanks. Hi, Yes you can use xsl to do this. See this article http://www.w3schools.com/XML/xml_xsl.asp for more information. In the artile the xsl transforms xml into html. similarly you can transform xml to another format xml using xsl  Please mark post as answer if it helped youMy Blog...

The local XML file './data/bugzilla-update.xml' cannot be created. Please make sure the web server can write in this directory.
Hi All, With bugzilla 3.0, after login with admin. There is a error message "The local XML file './data/bugzilla-update.xml' cannot be created. Please make sure the web server can write in this directory." I have try below commands. # su - apache $ cd /var/www/html/bugzilla/data $ touch bugzilla-update.xml OK. Then relogin with admin There is a error message "The local XML file './data/bugzilla-update.xml' has an invalid XML format. Please delete it and try accessing this page again." We can see the web server can write in directory "....

RE: The local XML file './data/bugzilla-update.xml' cannot be created. Please make sure the web server can write in this directory.
Hi,=20 More accurate information about the mail previously sent, I misunderstood about the file (please read below). Regards /Cinthya ______________________________________________=20 From: Fabricius Lasse (Nokia-TP/Copenhagen) =20 Sent: Tuesday, July 17, 2007 11:43 AM To: support-bugzilla@lists.mozilla.org Cc: Kamberi Cinthya (Nokia-TP/Copenhagen) Subject: RE: The local XML file './data/bugzilla-update.xml' cannot be created. Please make sure the web server can write in this directory. Well, The file is not in the ./data directory at all.. The directory is n...

The local XML file './data/bugzilla-update.xml' cannot be created. Please make sure the web server can write in this directory. #2
Hi,=20 Lasse is helping me with the upgrade of bugzilla 2.22 to 3.0, and we are follwing the "Steps for Upgrading",=20 1. Sanity Check run, and all the warnings were fixed 2. backup made 3. Replace the files in our installation with the new version of bugzilla 4. Run the checksetup.pl after installation=20 It said that some of the old templates have to be removed, after that all says o.k. Now trying to open bugzilla we get: The local XML file './data/bugzilla-update.xml' cannot be created. Please make sure the web server can write in this directory. Th...

Replace a node from 1 xml file with a node from another xml file
Hi,  suppose i have these 2 xml files: File 1: <resultset morerecords="0" paging-cookie="1">accountid last="{D14D44AD-36D0-DC11-AA32-0003FF33509E}" first="{D14D44AD-36D0-DC11-AA32-0003FF33509E}" /></cookie>"> <result> ... <donotpostalmail name="Allow">0</donotpostalmail> <name>Adventure Works</name> <primarycontactid name="Abhijit Thakur" dsc="0" yomi="Abhijit Thakur">{0820590A-37D0-DC11-AA32-0003FF33509E}</primarycontactid>...

Web resources about - submitting an XML file to a server, saving the file on the server and reposting the data to another url - asp.net.xml-datasource

Victorian election Fact Check. What’s so bad about not submitting your policies to the Treasury for costing ...
The claim: The Coalition says Labor's refusal to submit its costings to treasury shows it can't be trusted to manage the economy.

Eels forward Kenny Edwards facing nine-month ban after submitting urine sample on behalf of teammate ...
A STAR Parramatta player is facing a nine-month ban from rugby league after impersonating an Eels teammate during a pre-season drug test.

Rules and tips for submitting letters
Rules and tips for submitting letters

Metadata / Submitting Your Instant Answer / DuckDuckHack
Community Platform of DuckDuckGo - Translate DuckDuckGo, use our XMPP or make your own user page!

Apple asks developers to begin submitting apps for OS X Mavericks ahead of October 22 event
... 22nd event where the company is expected to unveil new iPads alongside other product announcements, Apple today asked developers to begin submitting ...

Don’t File That Brief! The One Thing You Must Check Before Submitting
Much as the juiciest berries are impossible to find on a well-traveled path, finding the cases that set you apart from an average litigator requires ...

Apple submitting fourth plan for Georgetown Apple Store
Apple has been submitting design proposals for a Georgetown store in …

Augusta groups begin submitting applications for SPLOST funding
About 20 percent of what's expected to be a nearly $200 million tax package is already spoken for.

Goucher to allow students to apply by submitting a video
If your grades and SAT scores are less than stellar, you might still have a shot at getting into Goucher College with a two-minute video.

Submitting your content directly to Bing
Four easy ways to make sure your content gets in, or back in, to the Bing index. URL/Domain submit - submit your domain to us if you have a ...

Resources last updated: 11/28/2015 7:54:26 PM