Post Xml to Axd

A

Alex

Here is my scenario. I want to post XML to an AXD page (C#). Simple enough, however my test page that posts the XML, does happen to break into my Axd page on the Load function, but I do not have Session state. So, my question is, with my test XML provided, what are the steps I need to use to set this up?

Test XML (this is trivial): <test><name><first>A</first><last>M</last></name></test>

I then post the XML like this...
<HTML>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" action="Find/SearchEpic.axd" method="post">
<textarea name="searchQuery" cols="100" rows="15">
... my text xml goes here ...
</textarea>
<br>
<input type="submit" value="Post This XML">
</form>
</body>
</HTML>

Then I create an axd page...
public class SearchXml : System.Web.UI.Page {

protected override void OnLoad(EventArgs e) {

System.IO.StreamReader s = new System.IO.StreamReader(HttpContext.Current.Request.InputStream);



XmlDocument receiveXml = new XmlDocument();

.... et cetera ...

}

I process the posted XML input, but I do not have access to Session state, so I cannot get access to some values I need. Am I doing something wrong, or is this behavior expected? Also, in order to test this, should I set up a different way to post my xml as opposed to what I listed above? If so, could someone please show me in C#, the steps required to post XML?

Thanks,

Alex
 
M

Matt Berther

Hello Alex,

Hey Alex... I solved your problem and committed this to the CVS servers at
work... :=)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top