Last post May 26, 2011 12:06 PM by mwheeler
May 20, 2011 07:37 PM|mwheeler|LINK
I do not have any knowledge really when it comes to sending XML to an external URL using ASP.net (VB) and now find myself in a postion where I need to do this.
For example when the Send Stats button is clicked:
Private Sub ButtonSendStats_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonSendStats.Click
I need to send the following information to http://someurl.net. All of the data is in the file is always the same except for 3 fields:
Value of Count comes from TableCellCount.TextValue of Hours comes from TableCellHours.TextValue of Transactions comes from TableCellTransactions.Text
How do I send this data to this external URL and then get the response whether they received the data?
Thanks in advance
May 20, 2011 08:11 PM|Ken Tucker|LINK
You can use WebClient.uploadstring or webclient.uploadfile to post the xml to an url
May 22, 2011 01:24 AM|mwheeler|LINK
Thanks for responding. Unfortunately I tried what was indicated in the article and could not get anything to work with the above example as this is an area that I am unfamiliar with.
Could you provide and example based on the info I provided above?
May 22, 2011 01:57 AM|vipernet|LINK
Would something like,
Ceating a XML file from those Txt Files and then uploading the XML files to the websever work? Do you have Access to the Site Via Ftp?..etc?
What options do you have on the hosting Site? A SQL / MYSQL server?
You could use a XML but depending on your site traffic it may become slow for viewing on your site.
Maybe im miss understanding what you ae asking or need :)
May 22, 2011 10:12 AM|mwheeler|LINK
Ok here is the context of what I need to do.
There is a web site directory that runs on php that we need to send certain statistics from our web site to and they have provided us with an URL and the the xml format I have posted above and want to be able to send this data when a user on our web site
pushes a button.
May 23, 2011 05:02 AM|Decker Dong - MSFT|LINK
Can you try to store the whole xml's contents into a variable and send directly, something like:
Response.Redirect("XXX/aspx?xmlcontents="+your xml contents variable);
May 26, 2011 12:06 PM|mwheeler|LINK
It took a little bit of work, but managed to get it working based on the following article:
Thanks for all your help guys.