>Macromedia, fix cfhttp and you'll likely get a double upgrade from
>me. I'll purchase 5.0 now and eventually MX when it's stable.
Unfortunatley you can't buy 5.0 anymore, well maybe on e-bay.
I would recommend using a custom tag replacemnet for cfhttp anyway bud, even
when it works, cfhttp is damn slow.
I have used to methods, one is Lewis Sellers's tcpclient.dll, which is nice
and fast and stable. And recenlty, a java cfx which is amazingly fast, java
would seem to be the way to go, it's honestly not that hard either. I'll add
the source of what I came up with, it's for posting XML but it should be
very easy to modify to your needs. Give the java a go, you won't regret it.
Craig.
-------------Code Start-----------------
import com.allaire.cfx.* ;
import java.io.* ;
import java.net.* ;
import java.util.* ;
public class sendXMLDataToRM implements CustomTag{
public void processRequest( Request request, Response response ) throws
Exception
{
if ( !request.attributeExists("xmlData") ||
!request.attributeExists("Url") )
{
throw new Exception(
"Missing attribute (xmlData and Url are both required
attributes for this tag)" ) ;
}
String Url = request.getAttribute("Url") ;
String xmlData = request.getAttribute("xmlData");
URL url = new URL( Url );
HttpURLConnection connection = ( HttpURLConnection )
url.openConnection();
connection.setDoOutput( true );
connection.setDoInput( true );
connection.setRequestMethod( "POST" );
connection.setUseCaches( false );
connection.setRequestProperty( "Content-type",
"application/x-www-form-urlencoded");
String dataString = "XMLDATA=" + URLEncoder.encode(xmlData);
/* form field name = XMLDATA, change to suit, if you don't want to encode
the variable, simply remove the URLEncoder.encode() */
DataOutputStream dos = new DataOutputStream(
connection.getOutputStream() );
dos.writeBytes( dataString );
dos.flush();
dos.close();
InputStream is = connection.getInputStream();
BufferedReader reader = new BufferedReader( new
InputStreamReader( is ));
StringBuffer answer = new StringBuffer();
String line = null;
while ( ( line = reader.readLine() ) != null ){
answer.append(line);
}
is.close();
response.setVariable( "xmlResponse", answer.toString()); /*
xmlResponse <- variable returned to cf template, change name to suit your
needs */
}
}
-------------Code End-----------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.