Solved

Convert coldfusion http post to ASP code.

Posted on 2003-10-27
8
263 Views
Last Modified: 2013-12-24
I have been supplied with the following coldfusion code, I know that it works for what I need:

<cfhttp url             = "http://gateway.textforce.net/sendsms.cfm"
                      method          = "POST"
                      port            = "80"
                      resolveurl      = "false"
                      throwonerror    = "yes">
<cfhttpparam type="FormField" name="xml" value="#xmlout#">
</cfhttp>

I need the equivalent code in ASP.
I already have this, but it is missing some of the parts above.
(especially how to post the form field)

<%
Set XMLRequest = Server.CreateObject("MSXML2.ServerXMLHTTP")
XMLRequest.open "POST", "https://gateway.textforce.net/sendsms.cfm", False
XMLRequest.SetRequestHeader "Host", "gateway.textforce.net"      
XMLRequest.SetRequestHeader "Connection", "Keep-Alive"
XMLRequest.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
%>

Please can someone supply me with the full code?

Regards

Alex
0
Comment
Question by:videnda
8 Comments
 
LVL 11

Expert Comment

by:hart
ID: 9626360
chack this link out
it has XMLRequest.send XMLString maybe that is what u r missing

http://www.experts-exchange.com/Web/Web_Languages/XML/Q_20751743.html

Regards
Hart
0
 
LVL 11

Expert Comment

by:hart
ID: 9626374
also this link
http://www-level3.experts-exchange.com/Web/Web_Languages/XML/Q_20735798.html

i checked the name in the question, it was urs. ??

Regards
Hart
0
 
LVL 11

Expert Comment

by:hart
ID: 9626387
als check this link out
http://www.codetoad.com/forum/18_22621.asp

Regards
hart
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:videnda
ID: 9626810
The code you are refering to from a previous question is to post a string.  I am now asking how to set the other parameters, fopr example the throwonerror, and in particular how to post the string as a form field named 'xml' with a value set as the string as in the following code.

<cfhttp url             = "http://gateway.textforce.net/sendsms.cfm"
                     method          = "POST"
                     port            = "80"
                     resolveurl      = "false"
                     throwonerror    = "yes">
<cfhttpparam type="FormField" name="xml" value="#xmlout#">

Thanks for your help so far.
0
 
LVL 9

Expert Comment

by:shooksm
ID: 9628958
Try this:

<%
Set XMLRequest = Server.CreateObject("MSXML2.ServerXMLHTTP")
XMLRequest.open "POST", "https://gateway.textforce.net/sendsms.cfm", False
XMLRequest.SetRequestHeader "Host", "gateway.textforce.net"    
XMLRequest.SetRequestHeader "Connection", "Keep-Alive"
XMLRequest.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
XMLRequest.send("xml=" & Server.URLEncode(xmlout))
%>
0
 
LVL 9

Expert Comment

by:shooksm
ID: 9732741
The exact same question was asked in the following question and was answered:

http://www.experts-exchange.com/Web/Web_Languages/XML/Q_20735798.html

I see no issues with refunding the points since this is a duplicate question.
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 9755492
PAQed, with points refunded (50)

SpazMODic
EE Moderator
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now