c# - HTTP POST from Classic ASP to WCF REST Service -


this question has answer here:

i have website has legacy, classic asp code. website has number of forms, when user clicks on submit button, should post input 2 forms , not more. furthermore, made wcf rest service responds http post requests , returns xml. if try http post current code, content input fields combined , sent via http post. not want. should simple xml myself generate , send further rest service, afterwards returns text string telling me, whether successful request or not. how do this? tried search both google , so, there nothing helpful.

you want form submit page control , construct xml. once have created payload want use serverxmlhttp object below.

set xmlhttp = createobject("msxml2.serverxmlhttp")     xmlhttp.open "post", url, false ' usage xmlhttp.open method, url, async xmlhttp.setrequestheader "content-type", "text/xml"     xmlhttp.send payload ' payload variable containing xml responsetxt =  xmlhttp.responsetext  httpstatus = xmlhttp.status  statustext = xmlhttp.statustext set xmlhttp = nothing  

afterwards need check httpstatus see if succeeded (httpstatus=200) , contents of responsetxt is.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -