Solved

Convert coldfusion http post to ASP code.

Posted on 2003-10-27
8
265 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

770 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