Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 23rd, 2014, 01:24 PM
Registered User
 
Join Date: Apr 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Cool How to get the post XML on asp page

Hi MadhuKP,

I am also doing the same thing, Like i have an URL where i need to do http post on url "http://localhost/TestVBScript/RecieveRequest.asp" and i am using below code on my sendrequest.asp page

Dim data, httpRequest, postResponse

data = "<?xml version=""1.0"" encoding=""UTF-8""?><School><Class>5</Class></School>"


Set httpRequest = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
httpRequest.Open "POST", "http://localhost/TestVBScript/RecieveRequest.asp", True
httpRequest.SetRequestHeader "Content-Type", "text/xml"
httpRequest.Send data

Now I want to get the string XML value on RecieveRequest page. So that i can process my XML and get the response

Any help will be appreciated. Thanks in advance
 
Old April 24th, 2014, 12:15 AM
Friend of Wrox
 
Join Date: Feb 2014
Posts: 136
Thanks: 1
Thanked 10 Times in 10 Posts
Default

You can also post data to a page on the server by sending it as mime-multipart form data. It is less cumbersome and the data can be access via the request form property of the page. I had to implement a mime service that could accept posted data this way.
 
Old April 24th, 2014, 05:30 AM
Registered User
 
Join Date: Apr 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You Morgan,

For quick response, I have to use XML http object only and with this i have to achieve my task, I am posting the XML from one of the page in my project to another page of same project. I just need to receive the XML on that page so that I can format the XML according to my need and send it to the API for response.
 
Old April 24th, 2014, 10:10 PM
Friend of Wrox
 
Join Date: Feb 2014
Posts: 136
Thanks: 1
Thanked 10 Times in 10 Posts
Default

You can post the xml data in a named content-disposition and submit that as mime-multipart http request. it can then be accessed on the server by passing the content-dispostion name to request form property.

i.e
example client posting code
Code:
 var contentName = "Data";
            var mimeboundry = "-----MimeBoundry-----";
            string footer = String.Format( "\r\n--{0}--\r\n",mimeboundry) ;
            var xmldata = "<blah></blah>";

            HttpWebRequest request = WebRequest.Create("someurl") as HttpWebRequest;

           
            // Set up the request properties.
            request.Method = "POST";
            request.ContentType = String.Format( "multipart/form-data; boundary={0}", mimeboundry );            
            request.ContentLength = xmldata.Length;

            var formdata = string.Format("{0}\r\nContent-Disposition: form-data; name=\"{1}\"\r\n\r\n{2}{3}", mimeboundry, contentName, xmldata, footer);
            using (var requestStream = request.GetRequestStream())
            {
                using (var requestWriter =  new StreamWriter(requestStream))
                {
                    requestWriter.Write(formdata);
                    requestStream.Close();
                }
            }

            return request.GetResponse() as HttpWebResponse;
example server side code to read post xml data
Code:
 var xml = Request.Form["Data"] // "Data" is the name of the content disposition
 
Old April 25th, 2014, 12:20 AM
Registered User
 
Join Date: Apr 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to KarenMaloney
Default Lipo 13 - Many benefits easily now in body

Lipo 13 Use it regularly and see the beneficial changes in your health.. Indisputably, those of you who know me know that I dislike lipo 13. This supplement will help you to maintain ideal body weight and quickly burn your body fat.
click for more info:- https://storify.com/shrnrpscornsh/lipo-13-clean-and-slim-body-easily
 
Old April 28th, 2014, 01:44 AM
Registered User
 
Join Date: Apr 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Lose more weight effectively

Is it accurate to say that you are buckling down for weight reduction? All things considered, then you likely wish for speedier results? Actually, let us spare your time and help you avoid those prevailing fashion abstains from food as their effects don't keep going. You have healthier and viable alternative, that is Total Health Garcinia. With this supplement, you can undoubtedly get more fit quicker. To know all the more about the recipe, continue perusing...





Similar Threads
Thread Thread Starter Forum Replies Last Post
form submitting cro_crx Pro PHP 5 January 25th, 2005 12:19 PM
Form Submitting cro_crx Beginning PHP 3 January 17th, 2005 01:30 PM
Submitting a form YuliaKupina Classic ASP Basics 3 June 24th, 2004 01:52 AM
Using XMLHTTP to POST form data channer Classic ASP XML 8 January 6th, 2004 05:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.