Click here to Skip to main content
15,888,286 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Sample code to post a asp.net forms data to third party API in XML input Pin
Richard MacCutchan7-Sep-14 22:15
mveRichard MacCutchan7-Sep-14 22:15 
AnswerRe: Sample code to post a asp.net forms data to third party API in XML input Pin
Bernhard Hiller7-Sep-14 22:06
Bernhard Hiller7-Sep-14 22:06 
QuestionHow to implement a Treeview / Form interface. Pin
Wierdbeard656-Sep-14 4:21
Wierdbeard656-Sep-14 4:21 
AnswerRe: How to implement a Treeview / Form interface. Pin
jkirkerx6-Sep-14 12:30
professionaljkirkerx6-Sep-14 12:30 
GeneralRe: How to implement a Treeview / Form interface. Pin
Wierdbeard656-Sep-14 15:21
Wierdbeard656-Sep-14 15:21 
GeneralRe: How to implement a Treeview / Form interface. Pin
jkirkerx6-Sep-14 16:20
professionaljkirkerx6-Sep-14 16:20 
GeneralRe: How to implement a Treeview / Form interface. Pin
Wierdbeard6512-Sep-14 6:54
Wierdbeard6512-Sep-14 6:54 
QuestionNeed to POST xml data to web device w/ c# ASPX Pin
Member 110616635-Sep-14 5:36
Member 110616635-Sep-14 5:36 
I need to POST a set of XML data to a web device. I'm most familiar with ASPX / c#. Basically the user lands on my page and I retrieve two parameters from the URL and store them as Session Variables (like this):

<script runat="server">
 
  Sub Page_Load()
        dim MA as String
        MA = Request.QueryString("MA")
        Session.Add("MAC_ADDRESS", MA)
        Message.Text = Session("MAC_ADDRESS")
     End Sub
</script>



I realize the above is currently VB, but I'm going to switch this to c# (as I'm more familiar with it). I need to use these session variables to POST XML formatted data to a URL:

POST TO: ([IP_Address]/command.xml)

Example XML:

<?xml version="1.0" ?>
<!DOCTYPE ABC "UserAdd.dtd">
 
<ABC COMMAND="USER_ADD" MAC_ADDR="Session("MAC_ADDRESS")>
  <EXPIRY_TIME UNITS="SECONDS">60</EXPIRY_TIME>
</ABC>



Once the Device receives the command, it sends back a response (OK or Error), I also need to retrieve and verify the response (just a Response.Write to screen would be fine). I've never done anything like this before so any help is greatly appreciated!

Thanks!
Brad

EDIT:

Here is a Javascript version that WORKS. This is based on a form where the user fills out the fields that makeup the XML (I'm only using MAC_ADDRESS right now, none of the others). If Someone Could help me translate whats happening here to c# in a simpler way, I would be MOST appreciative!

function SendXML()
{
	var usg = template.XMLDocument

	clearResults();

	usg.async = false;
	usg.preserveWhiteSpace = false;

	BuildEls(usg);

	document.all("xmlCommand").insertAdjacentText("BeforeEnd",
   		usg.xml);

	var httpOb = new ActiveXObject("Microsoft.XMLHTTP");
	httpOb.Open("POST", usgAddr, false);
	httpOb.send(usg);

   document.all("xmlResponse").insertAdjacentText("BeforeEnd",
   		httpOb.responseXML.xml);
}


modified 5-Sep-14 15:06pm.

QuestionAsp.net GridView with JQuery Pin
Member 106549793-Sep-14 20:41
Member 106549793-Sep-14 20:41 
QuestionRe: Asp.net GridView with JQuery Pin
ZurdoDev5-Sep-14 6:19
professionalZurdoDev5-Sep-14 6:19 
QuestionConverting Word document to HTML page Pin
meeram393-Sep-14 19:14
professionalmeeram393-Sep-14 19:14 
SuggestionRe: Converting Word document to HTML page Pin
Kornfeld Eliyahu Peter3-Sep-14 20:14
professionalKornfeld Eliyahu Peter3-Sep-14 20:14 
QuestionEncoding password sent to MVC web service reports vulnerability issues Pin
Stephen Holdorf3-Sep-14 8:22
Stephen Holdorf3-Sep-14 8:22 
QuestionAjax call Error when using FileStream in code Pin
pawan Jha19883-Sep-14 2:59
pawan Jha19883-Sep-14 2:59 
AnswerRe: Ajax call Error when using FileStream in code Pin
Richard Deeming3-Sep-14 3:32
mveRichard Deeming3-Sep-14 3:32 
GeneralRe: Ajax call Error when using FileStream in code Pin
ZurdoDev3-Sep-14 3:36
professionalZurdoDev3-Sep-14 3:36 
GeneralRe: Ajax call Error when using FileStream in code Pin
pawan Jha19884-Sep-14 0:54
pawan Jha19884-Sep-14 0:54 
QuestionThe request failed with HTTP status 401: Unauthorized Pin
Member 101656822-Sep-14 2:38
Member 101656822-Sep-14 2:38 
AnswerRe: The request failed with HTTP status 401: Unauthorized Pin
Jameel VM2-Sep-14 3:41
Jameel VM2-Sep-14 3:41 
GeneralRe: The request failed with HTTP status 401: Unauthorized Pin
Member 101656822-Sep-14 20:07
Member 101656822-Sep-14 20:07 
SuggestionRe: The request failed with HTTP status 401: Unauthorized Pin
Richard Deeming3-Sep-14 1:44
mveRichard Deeming3-Sep-14 1:44 
AnswerRe: The request failed with HTTP status 401: Unauthorized Pin
Bernhard Hiller2-Sep-14 21:19
Bernhard Hiller2-Sep-14 21:19 
QuestionAsp .Net MVC ver 4 - Change standard css template Pin
Piotrekneo182-Sep-14 0:07
Piotrekneo182-Sep-14 0:07 
AnswerRe: Asp .Net MVC ver 4 - Change standard css template Pin
Jameel VM2-Sep-14 3:36
Jameel VM2-Sep-14 3:36 
GeneralRe: Asp .Net MVC ver 4 - Change standard css template Pin
Piotrekneo184-Sep-14 10:18
Piotrekneo184-Sep-14 10:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.