Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have to post data of a html form to an url and then read response in xml format. Again I have to parse that xml and take data from url xml and again I have to post another url.

Blow I have tried some code but getting results.
Please Help.

XML
<head runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge, chrome=1"/>
<script>
    "use strict";
    function submitForm(oFormElement) {
        var xhr = new XMLHttpRequest();
        xhr.onload = function () { alert(xhr.responseText); }
        xhr.open(oFormElement.method, oFormElement.action, true);
        xhr.send(new FormData(oFormElement));
        return false;
    }
</script>

</head>




XML
<body>

    <form method="post" name="customerData" action="https://abc.com/abc/epi/fts" id="customerData" onsubmit="return submitForm(this);">


         <input  name='login' value='160' readonly="readonly" hidden="hidden"/>
         <input  name='pass' value='Test@123' readonly="readonly" hidden="hidden" />
          <input  name='ttype' value='NBFundTransfer' readonly="readonly" hidden="hidden"/>
          <input  name='prodid' value='NSE' readonly="readonly"hidden="hidden" />
        <input  name='amt' value="<%Response.Write(Request.QueryString["TXN_AMOUNT"]);%>" readonly="readonly"hidden="hidden" />
        <input  name='txncurr' value='INR' readonly="readonly"hidden="hidden" />
         <input  name='txnscamt' value='0' readonly="readonly"hidden="hidden"/>
         <input  name='clientcode' value="<%Response.Write(b64);%>" readonly="readonly" type="hidden"/>
         <input  name='txnid' value="<%Response.Write(Request.QueryString["orderid"]);%>" readonly="readonly" hidden="hidden" />
        <input  name='date' value="<%Response.Write(d);%>" type='hidden'hidden="hidden"/>
        <input  name='custacc' value="<%Response.Write(Request.QueryString["EMAIL"]);%>" type='hidden'hidden="hidden"/>

          <input type="submit" onclick="btnclick" id="btnclick" />
        </form>

</body>




now I got some xml data .....




XML
<?xml version="1.0" encoding="UTF-8" ?>
<MMP>
<MERCHANT>
<RESPONSE>
<url>https://abc.com/abc/epi/fts</url>
<param name="ttype">NBFundTransfer</param>
<param name="tempTxnId">2418</param>
<param name="token">ClT6Sr4mjGhvFpsiBaUwaorib62ihEwLUh69hNKBUAE%3D</param>
<param name="txnStage">1</param>
</RESPONSE>
</MERCHANT>
</MMP>



i'm absolute beginner in asp.net and not getting logic to repost data after parsing xml.
I did lots of search on google but confused, How to do
Posted
Comments
What is the exact issue? Did you read that response?
diggudg 2-May-15 4:42am    
No, I'm trying to read response, but not getting.
I need help to read xml data and to asssign in variable and re-post to another url.

1 solution

Refer - AJAX - Server Response[^]. Read the XML and do whatever you want to do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900