• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFXML error

Participant ,
Mar 04, 2007 Mar 04, 2007

Copy link to clipboard

Copied

Does anyone have a clue why I'm getting this message?

The tag name "CFXML" is not a properly formed name for a ColdFusion Extension (CFX).

TOPICS
Advanced techniques

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 04, 2007 Mar 04, 2007

Copy link to clipboard

Copied

rboudwin wrote:
> Does anyone have a clue why I'm getting this message?

which ver of cf?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 05, 2007 Mar 05, 2007

Copy link to clipboard

Copied

Thank you. It was a version problem.

Is it okay to put <cfoutput> variables/tags within the cfxml tag like I did?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 05, 2007 Mar 05, 2007

Copy link to clipboard

Copied

rboudwin wrote:
> Is it okay to put <cfoutput> variables/tags within the cfxml tag like I did?

sure.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 06, 2007 Mar 06, 2007

Copy link to clipboard

Copied

I'm getting an error. Any clues?

"An error occured while Parsing an XML document"
"The markup in the document following the root element must be well-formed."

Any ideas? All the code appears to be okay.

<cfdump var="#xmlString#">

<!--TEST-->
<cfhttp URL="https://apitest.authorize.net/xml/v1/request.api" method="post">
<cfhttpparam name="xmlString" value="#xmlString#" type="xml">
</cfhttp>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 06, 2007 Mar 06, 2007

Copy link to clipboard

Copied

This should be a simple XML submittal to Authorizenet ARB. I haven't been able to find any sample code. It seems like there would be something since it's AUthorizenet.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 06, 2007 Mar 06, 2007

Copy link to clipboard

Copied

You didn't show us the XMLstring, I suspect that is the key.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 06, 2007 Mar 06, 2007

Copy link to clipboard

Copied

I got it! It's important to include the header!

<ARBCreateSubscriptionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">

I hope this helps someone else. There doesn't seem to be much documentation on it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 06, 2007 Mar 06, 2007

Copy link to clipboard

Copied

I have NO idea how to parse the XML response from my post. Any help is welcomed. Is there a tag like CFXML?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 06, 2007 Mar 06, 2007

Copy link to clipboard

Copied

I have NO idea how to parse the XML response from my post. Any help is
welcomed. Is there a tag like CFXML?

Other then <cfxml>?

Don't parse it, just dump out the XML string and see what it looks like.

<cfoutput>#xmlString#</cfoutput> Then view source to see the tags.

You can play with the htmlCodeFormat() and xmlFormat() functions for
prettiness.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 06, 2007 Mar 06, 2007

Copy link to clipboard

Copied

I'm not sure if I understand XML well enough to communicate this clearly. The initial CFXML that I sent appears to be working without errors. I dump out the XML string and output the string as you suggested. This shows the xml information that is submitted via a cfhttp post. There should be a response from the place that the xml post is sending to with a returned xml response. I'm not sure how to read the returned xml response from authorizenet showing if it was approved or had an error. I've attached my complete code to make it easier to understand.

I'm not sure what to do after I submit it to get the response xml back (not what I sent).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 06, 2007 Mar 06, 2007

Copy link to clipboard

Copied

Thanks for your replies. I see why I wasn't "seeing" my response. I was getting an error, "connection failure." I'm beginning to believe it's to do with cfhttp. So . . . this is taking much more time than it should. Anyone else having trouble connecting with cfhttp?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 07, 2007 Mar 07, 2007

Copy link to clipboard

Copied

So . . . this is taking much more time than it should. Anyone
else having trouble connecting with cfhttp?

No, I have used cfhttp just fine. What happens if you go to that URL in
a browser?

One thing that looks odd to me. You are using <cfxml...>. This creates
an XML OBJECT, not a STRING, in the CF memory. You are not going to be
able to pass an OBJECT like this through an HTTP Post parameter. You
could use the toString() function to convert that object to a string.

A better solution my be to use the <cfsavecontent var="xmlString"> tag
instead of the <cfxml...> tag. This tag creates a string by default.
Other then this, it has a second advantage over the <cfxml...> tag in
that you can use different <?xml ... ?> prolog. With the <cfxml...>
tag, a standard prolog is used and it can not be easily changed, if one
wants to use a different one. Of course, if one wants this string to
become an object on the cf server one would use the xmlParse() function.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 07, 2007 Mar 07, 2007

Copy link to clipboard

Copied

CFXML and cfsavecontent are unfamiliar territory for me. Thank you for guiding me.

I'm still getting the same error, "Connection failure." I have to think it is something basic that I'm missing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 07, 2007 Mar 07, 2007

Copy link to clipboard

Copied

CFXML and cfsavecontent are unfamiliar territory for me. Thank you for
guiding me.

<cfsavecontent variable="myXML"><cfoutput><?xml version='1.0'
encoding='UTF-8'?>
<XML Code goes here>
</cfsavecontent>

<cfset stringXML = tostring(#myXML#)>

I can see that. You are still incorrectly matching functions.
<CFXML...> creates a ColdFusin XML object. You would use the
toString(xmlOjbect) if you wanted a string representation of that object.

<cfsaveContent ...> Creates a String, xml or otherwise. You would use
xmlParse() of an xml string if you wanted an object.

An experiment for some edification.

<cfxml variable="aVar">
<root>
<node>A</node>
<node>B</node>
</root>
<cfxml>

<cfdump var="#AVar#">

<cfoutput>#toString(aVar)#</cfoutput>

<cfsaveContent variable="bVar">
<root>
<node>A</node>
<node>B</node>
</root>
</cfsaveContent>

<cfoutput>#bVar#</cfoutput>

<cfdump var="#xmlParse(bVar)#">


For the other potential issue, are you sure the CF server can access
that url resource. That there is no firewall, proxy or other security
layer preventing access.

What happens if you put 'https://api.authorize.net/xml/v1/request.api'
in the the location bar of your favorite browser? What happens if you
do this from the CF server? Assuming you have direct access to the CF
server.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 07, 2007 Mar 07, 2007

Copy link to clipboard

Copied

When I put the url in my browser, this is what I get:

<?xml version="1.0" encoding="utf-8" ?>
- <ErrorResponse xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
- <messages>
<resultCode>Error</resultCode>
- <message>
<code>E00002</code>
<text>The content-type specified is not supported.</text>
</message>
</messages>
</ErrorResponse>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 07, 2007 Mar 07, 2007

Copy link to clipboard

Copied

Okay, I see that I was mixing ideas. Thank you for clarifying! (The sample you gave has a simple typo in case anyone else reads this post and tests it - two opening cfxml tags.)

So . . . when I post via http, I want it in a string or as an object? Does that depend on the recipient? I would assume as an object.

I'm also not finding "official" documentation that cfhttpparam has a type "xml." I see it in examples and other posts, but I'm wondering if this could be part of the problem - matching data types.

Interesting. When I apply the correct dump info to my code, I get:
"An error occured while Parsing an XML document"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 07, 2007 Mar 07, 2007

Copy link to clipboard

Copied

So . . . when I post via http, I want it in a string or as an object?
Does that depend on the recipient? I would assume as an object.

I'm also not finding "official" documentation that cfhttpparam has a
type "xml." I see it in examples and other posts, but I'm wondering if
this could be part of the problem - matching data types.


Actually the opposite, you would us a string. CFHTTP, is just http
requests - you are doing a fancy form post. The code you provide could
be replaced by a form something like this. You would not expect an
object to work in a form input.

<form action="https://api.authorize.net/sml/v1/request.api" method="post">
<input type="hidden" name="XMLUpload" value="#xmlString#"
</form>

Obviously this would not do anything without some type of action to
generate a submit in the browser.

If you are expecting to use <cfhttp...> you should be using a string,
the string just needs to be a valid representation of XML.

If this is a web service, and you do need to pass in an actual object,
then you need to be using other options, such as createObject(),
<cfobject...> or <cfinvoke...> to access it as an web service to which
you can pass complex objects.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 10, 2007 Mar 10, 2007

Copy link to clipboard

Copied

LATEST
I ended up using cfsavecontent with a cfhttp. I was getting connection failure errors. After days of researching this, I found documentation regarding a bug. I was finally able to connect to the test site, but I never could connect to the produciton site at Authorize.Net. After a full week of requesting help from the development team, they never responded. We're going a different route because it is too unstable. Thank you for all of your help!

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19139

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=95f66fd8

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18198

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18172


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation