将php函数curl_init()转换为coldfusion

将php函数curl_init()转换为coldfusion,coldfusion,Coldfusion,我需要将这段PHP代码转换为coldfusion: 没有参数xml,因为参数是必需的 <?php $_string = '<SPCA-XML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.scpc.inf.br/spcn/spcaxml.xsd"> <VERSAO>20131120</VERSAO>

我需要将这段PHP代码转换为coldfusion: 没有参数xml,因为参数是必需的

<?php

$_string = '<SPCA-XML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.scpc.inf.br/spcn/spcaxml.xsd">
    <VERSAO>20131120</VERSAO>
    <SOLICITACAO>
        <S-CODIGO>2122</S-CODIGO>
        <S-SENHA>5454</S-SENHA>
        <S-CONSULTA>4545</S-CONSULTA>
        <S-SOLICITANTE>XXXXXX</S-SOLICITANTE>
        <S-CPF>2222222</S-CPF>
        <S-TIPO-CREDITO>CD</S-TIPO-CREDITO>
    </SOLICITACAO>
</SPCA-XML>';

$_post = curl_init();
curl_setopt($_post, CURLOPT_URL, "https://www.scpc.inf.br/cgi-bin/spcaxml");
curl_setopt($_post, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($_post, CURLOPT_POSTFIELDS, $_string);
curl_setopt($_post, CURLOPT_RETURNTRANSFER, 1);
$_result = curl_exec($_post);
curl_close($_post);

header("Content-type: text/xml");
echo $_result;

?>

您可以这样做:

<cfsavecontent variable="xmlString">
    <SPCA-XML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.scpc.inf.br/spcn/spcaxml.xsd">
        <VERSAO>20131120</VERSAO>
        <SOLICITACAO>
            <S-CODIGO>2122</S-CODIGO>
            <S-SENHA>5454</S-SENHA>
            <S-CONSULTA>4545</S-CONSULTA>
            <S-SOLICITANTE>XXXXXX</S-SOLICITANTE>
            <S-CPF>2222222</S-CPF>
            <S-TIPO-CREDITO>CD</S-TIPO-CREDITO>
        </SOLICITACAO>
    </SPCA-XML>'
</cfsavecontent>
<cfhttp url="https://www.scpc.inf.br/cgi-bin/spcaxml" method="post" result="result">
    <cfhttpparam type="header" name="Content-Type" value="text/xml" />
    <cfhttpparam type="xml" value="#xmlString#" />
</cfhttp>
<cfdump var="#result#">

20131120
2122
5454
4545
XXXXXX
2222222
光盘
'
以下是回应的内容:


@James A Mohler建议,有关代码的更多信息,请浏览链接。

到目前为止,您尝试了什么?您可能需要先查找