Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php NodeJS Soap请求/响应_Php_Node.js_Soap_Node Soap - Fatal编程技术网

Php NodeJS Soap请求/响应

Php NodeJS Soap请求/响应,php,node.js,soap,node-soap,Php,Node.js,Soap,Node Soap,NodeJS中的请求或解析响应不正确。但它在PHP中工作 以下是可用的PHP版本: ini_set("soap.wsdl_cache_enabled", "0"); try { $oWsdl = @new \SoapClient( "https://xml.proveid.experian.com/IDSearch.cfc?wsdl", array( "exceptions" => 1, "timeo

NodeJS中的请求或解析响应不正确。但它在PHP中工作

以下是可用的PHP版本:

ini_set("soap.wsdl_cache_enabled", "0");

try {
    $oWsdl = @new \SoapClient(
        "https://xml.proveid.experian.com/IDSearch.cfc?wsdl",
        array(
            "exceptions" => 1,
            "timeout" => 0,
            "connect_timeout" => 0,
            "ssl_verify_peer" => false,
        )
    );
    $sAnswer = $oWsdl->Search(getXML());
}
catch (\SoapFault $e)
{
    throw $e;
}

print_r($sAnswer);


// ******************************************
function getXML() {
    return <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<Search>
    <Authentication>
        <Username>test_acc</Username>
        <Password>test_pw</Password>
    </Authentication>
    <CountryCode>GBR</CountryCode>
    <Person>
        <Name>
            <Forename>Wexhuy</Forename>
            <Surname>Cutfamjungofguc</Surname>
        </Name>
        <Gender></Gender>
        <DateOfBirth>1987-02-17</DateOfBirth>
    </Person>
    <Addresses>
        <Address Current="1">
            <Premise>random</Premise>
            <Postcode>BD634HP</Postcode>
            <CountryCode>GBR</CountryCode>
        </Address>
    </Addresses>
    <SearchOptions>
        <ProductCode>ProveID_AML</ProductCode>
        <DecisionCode>Ssdz</DecisionCode>
    </SearchOptions>
</Search>
XML;
}
如何修复NodeJS版本


可能需要一些标题或信封?

很有趣。。。那么你的问题是什么?还是你只是告诉我们第二个片段不起作用?
soap.createClient(url , function(err, client) {
    client.search(xml, function(err, result) {
        if(err) {
            console.log("Error:", err.message); // Error: Cannot parse response    
        }
        console.log(result); // {}
    });
});