cfhttp POST returning 404 error - Page not Found trying to send XML

Posted on 2006-03-30
Last Modified: 2013-12-20
I am trying to use coldfusion to POST to a webservice using XML but keep getting 404 error's. The webserice is from a large image processing company and they work with many different companies. They have no one in their technical department that knows coldfusion so they cannot help me with sample code etc.

What I am trying to do is POST an XML header and text to their webserice using cfhttp command. Everything tells me it should be working but it keeps failing by returning the 404 error. It should return XML with a 0 for everything ok or an error number for various types of problems within the XML itself.

Here is my code. Can someone tell me what I am doing wrong? I am using MX 7 running on a MS IIS server.

I try to kick it off by opening my browser and going to this page on our webserver which has coldfusion MX 7 running.
<cfset XMLcont ='
<?xml version="1.0" encoding="UTF-8"?>
<AdMissionRequest Version="1.0">
<Body>My custom message goes here.</Body>
<Parameter Name="EditLink" Value=""/>
<Parameter Name="Photocode" Value="1234XLW"/>
<Parameter Name="Description"></Parameter>

<cfset XMLdoc ='
POST /rimfire/admission HTTP/1.1
User-Agent: My Application Name
Content-Type: text/xml
Content-Length: '>

<cfset XMLdoc = XMLdoc & len(XMLcont) & XMLcont>

<cfhttp method="post" url="">
   <cfhttpparam type="header" name="Content-Type" value="text/xml" />
   <cfhttpparam type="xml" name="xmlDoc" value="#XMLdoc#"/>

<cfdump var="#XMLdoc#">

File Content:<br>
Mime Type:  #cfhttp.MimeType#<br>

The above code should trigger thier webservice to send an email out to the email address listed in the XML above.

Thanks for looking,
Bob W.
Question by:acpress
    LVL 18

    Expert Comment


    If it is a webservce, why aren't you just invoking it using <cfobject or <cfinvoke

    Calling it your way is just not how it's done.

    LVL 2

    Author Comment

    The only way to use this webservice is to use a HTTP POST to it and in return it sends back XML code with one element letting you know if it worked or not. I cannot see how you could use CFINVOKE or CFOBJECT to send a POST with.

    Bob W.
    LVL 2

    Author Comment

    Figured out the problem myself....just switched to VB instead and worked like a charm... I still beleive there is an issue with coldfusion and http post.

    Bob W.

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
    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 update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

    758 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

    10 Experts available now in Live!

    Get 1:1 Help Now