Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2006-03-30
5
Medium Priority
?
398 Views
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">
<SendEMail>
<Account>pressofatlanticcity</Account>
<MediasetName>_PRESSOFATLANTICCITY_1234</MediasetName>
<AuthenticationToken>B9849FF9BD724A9E4AC26A248080CF96</AuthenticationToken>
<To>myemail@company.com</To>
<Bcc></Bcc>
<Template>createad.xsl</Template>
<Body>My custom message goes here.</Body>
<Parameter Name="EditLink" Value="http://forms.pressofatlanticcity.com/IPIX/submit_photos.cfm"/>
<Parameter Name="Photocode" Value="1234XLW"/>
<Parameter Name="Description"></Parameter>
</SendEMail>
</AdMissionRequest>
'>


<cfset XMLdoc ='
POST /rimfire/admission HTTP/1.1
Host: http://webservices-preprod.ipixmedia.com
User-Agent: My Application Name
Content-Type: text/xml
Content-Length: '>

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

<cfhttp method="post" url="http://webservices-preprod.ipixmedia.com/rimfire/admission">
   <cfhttpparam type="header" name="Content-Type" value="text/xml" />
   <cfhttpparam type="xml" name="xmlDoc" value="#XMLdoc#"/>
</cfhttp>

<cfdump var="#XMLdoc#">

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


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.
0
Comment
Question by:acpress
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Plucka
ID: 16338942
acpress,

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.

Regards
Plucka
0
 
LVL 2

Author Comment

by:acpress
ID: 16344575
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.
0
 
LVL 2

Author Comment

by:acpress
ID: 16345650
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.
0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16676738
PAQed with points refunded (500)

GranMod
Community Support Moderator
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

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…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
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…
Suggested Courses

581 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