cfhttpタグを使用する場合、cfhttpparamを介してbody+ヘッダーを含めます。
ColdfusionがXMLを送信する前に融合する方法が原因で、もう一方の端で構文エラーが発生します。
送信している正確なXMLを表示する、テスト用の呼び出しを指示できる一時的なCFCが必要です。
cfhttpリクエストで送信されている正確なXMLを確認するにはどうすればよいですか?
getHttpRequestData()を試しましたが、このメソッドは、探している構文ではなく構造を返します。
この質問に似たスレッドがありますが、私の特定のニーズには対応していません。 cfhttpリクエストを表示
<!--- Define Header --->
<cfsavecontent variable="soapHeader">
<cfoutput>
<soap:Header>
<wsse:Security soap:mustUnderstand="1">
<wsse:UsernameToken>
<wsse:Username>MyUser</wsse:Username>
<wsse:Password>MyPass</wsse:Password>
<wsse:Nonce>fsdf568sf234k</wsse:Nonce>
<wsu:Created>2012-01-07T06:17:56Z</wsu:Created>
</wsse:UsernameToken>
<wsse:Security>
</soap:Header>
</cfoutput>
</cfsavecontent>
<!--- Define Body --->
<cfsavecontent variable="soapBody">
<cfoutput>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<EmpCpsVerifyConnection xmlns="https://www.vis-dhs.com/EmployerWebService/" />
</soap:Body>
</soap:Envelope>
</cfoutput>
</cfsavecontent>
<!--- Make SOAP Request --->
<cfhttp
method="post"
url="https://stage.e-verify.uscis.gov/WebService/EmployerWebServiceV24.asmx?wsdl"
result="httpResponse">
<cfhttpparam
type="header"
name="SOAPAction"
value="https://www.vis-dhs.com/EmployerWebService/EmpCpsVerifyConnection"
/>
<cfhttpparam
type="header"
name="Security"
value="#trim( soapHeader )#"
/>
<cfhttpparam
type="body"
value="#trim( soapBody )#"
/>
</cfhttp>