From: bezly on
I?m trying to implement submission of an XML document from my website for
credit card processing using my merchant?s API.

Here?s the format I?m using for my request. For some reason I keep getting an
error message telling me ?Invalid Request Format. XML request is not
well-formed or request is incomplete.?

I know the XML itself is correct, as I can submit it directly through the URL
string in the browser and it works OK.

Here?s what I?m doing:

<cfsavecontent variable="strXML">

<!--- NOTE: test data below -- not my real data --->
<txn>
<ssl_merchant_ID>123456</ssl_merchant_ID>
<ssl_user_id>123456</ssl_user_id>
<ssl_pin>V6NJ3A</ssl_pin>
<ssl_transaction_type>ccsale</ssl_transaction_type>
<ssl_card_number>1111111111111111</ssl_card_number>
<ssl_exp_date>1210</ssl_exp_date>
<ssl_amount>2.34</ssl_amount>
<ssl_salestax>0.00</ssl_salestax>
<ssl_cvv2cvc2_indicator>1</ssl_cvv2cvc2_indicator>
<ssl_cvv2cvc2>321</ssl_cvv2cvc2>
<ssl_invoice_number>1234</ssl_invoice_number>
<ssl_customer_code>1111</ssl_customer_code>
<ssl_first_name>customer</ssl_first_name>
<ssl_last_name>name</ssl_last_name>
<ssl_avs_address>1234 main st.</ssl_avs_address>
<ssl_address2>apt b</ssl_address2>
<ssl_city>any town</ssl_city>
<ssl_state>ST</ssl_state>
<ssl_avs_zip>55555</ssl_avs_zip>
<ssl_phone>555-555-5555</ssl_phone>
<ssl_email>customer(a)email.com</ssl_email>
</txn>

</cfsavecontent>

<cfhttp
url="https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do?xmldata="
method="post">
<cfhttpparam type="XML" value="trim(strXML)">--->
</cfhttp>

<cfoutput>#cfhttp.FileContent#</cfoutput>



Can someone tell me what I?m doing wrong?

(The developer guide is available here:

https://www.myvirtualmerchant.com/VirtualMerchant/download/developerGuide.pdf)

thanks!

From: Ian Skinner on
<cfsavecontent variable="strXML">

<!--- NOTE: test data below -- not my real data --->
<txn>


Some xml parsers can be very sensitive to any extra anything, even white
space, preceding the xml root tag.

You may want to try this.
<cfsavecontent variable="strXML"><txn>
....
</cfsavecontent>

From: bezly on
I tried it -- thanks, but no luck. Doesn't the Trim() around the string take care of that though?

-B
From: Ian Skinner on
Looking deeper into your original post.

You say this...
"I know the XML itself is correct, as I can submit it directly through
the URL string in the browser and it works OK."

That would say to me you are using get URL parameters not post form
parameters. Also you don't put the name of the url parameter in the url
string, unless you put the value there. If you use the
<cfhttpparam....> tag, it should contain the name. Finally you seem to
be missing some pound signs.

Give this, or something like it, a try.

<cfhttp
url="https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do
method="get">
<cfhttpparam type="url" name="xmldata" value="#trim(strXML)#">
</cfhttp>
From: bezly on
:grin;

Thanks! You rock! I was pulling my hair out.

The trick ended up being using the name within the cfhttpparam as you
suggested.

<cfhttpparam type="url" name="xmldata" value="#trim(strXML)#">

Everything else is handles OK either way. (get/post)

-B