Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Convert coldfusion http post to ASP code.

Posted on 2003-10-27
8
Medium Priority
?
279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

670 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