RESTful API (会計アプリケーションによって提供される) をテストするための簡単なアプリケーションを作成しました。「GET and POST」XML をテストするために Firefox に「Poster」をインストールしましたが、API は正常に動作しています。テスト CF8 アプリケーション内から API を呼び出す単純な「GET」テスト ページを作成したところ、API は期待どおりの結果を返しました。テスト CF8 アプリケーション内から POST できません。
以下を application.cfm に挿入しました。
<!--- fix for HTTPS connection failures --->
<cfif NOT isDefined("Application.sslfix")>
<cfset objSecurity = createObject("java", "java.security.Security") />
<cfset objSecurity.removeProvider("JsafeJCE") />
<cfset Application.sslfix = true />
</cfif>
これは失敗しているコードです:
<cfprocessingdirective suppressWhiteSpace = "Yes">
<cfxml variable="customerxml">
<?xml version="1.0" encoding="UTF8" standalone="yes"?>
<dataentry>
<interface name="Customer Edit"></interface>
<entity>
<attribute name="Customer Code">REP003</attribute>
<attribute name="Customer Name">Repsol3</attribute>
<attribute name="Address Line 1">El House</attribute>
<attribute name="Address Line 2">El Street</attribute>
<attribute name="Address Line 3">El Town</attribute>
</entity>
</dataentry>
</cfxml>
</cfprocessingdirective>
<cfhttp
method="post"
url="https://***/wsapi/1.1/dataentry/"
username="***"
password="***"
charset="utf-8">
<cfhttpparam type="header" name="Accept-Encoding" value="*" />
<cfhttpparam type="header" name="TE" value="deflate;q=0" />
<cfhttpparam type="header" name="Content-Type" value="application/xml" />
<cfhttpparam name="XML_Test" type="xml" value="#customerxml#">
</cfhttp>
このトピックについては多くの記事が公開されており、私はほとんどのことを試しましたが、一部の投稿は私のものよりも古い CF バージョンに関するものです! 最新のヘルプをいただければ幸いです。