1

我的网站在 windows azure web-app 上。我正在使用下面的 SOAP 消息。

$soap_client = new SoapClient("http://ip_address/service.asmx?WSDL", array("trace" => true));

$params = new \SoapVar('<?xml version="1.0" encoding="utf-8"?>
                <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                <soap:Body>
                    <Beneficiary_Address1 xmlns="" />
                    <Beneficiary_Address2 xmlns="" />
                    <Beneficiary_Address3 xmlns="" />
                    <Beneficiary_ZIP_Code xsi:nil="true" xmlns="" />
                    <Beneficiary_EmailID xsi:nil="true" xmlns="" />
                    <Beneficiary_Contact_No xmlns="" />
                </soap:Body>
                </soap:Envelope>', XSD_ANYXML);

try{
    $response = $soap_client->__soapCall('RemittanceService', array($params));
    highlight_string($soap_client->__getLastRequest());
}
catch(SoapFault $fault){
    die("SOAP Fault: fault code: {$fault->faultcode}, fault string: {$fault->faultstring}");
}

它给了我这个fault message

故障代码:HTTP,故障字符串:错误请求

我不知道这是什么意思?如果您需要更多信息,请与我们联系。谢谢。

堆栈跟踪

SoapFault exception: [HTTP] Bad Request in /var/www/mtes/public_html/application/controllers/bank_api_pnb.php:146
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://124.124....', 'http://tempuri....', 1, 0)
#1 /var/www/mtes/public_html/application/controllers/bank_api_pnb.php(146): SoapClient->__soapCall('RemittanceServi...', Array)
#2 [internal function]: Bank_api_pnb->test()
#3 /var/www/mtes/public_html/system/core/CodeIgniter.php(359): call_user_func_array(Array, Array)
#4 /var/www/mtes/public_html/index.php(220): require_once('/var/www/mtes/p...')
#5 {main}
4

2 回答 2

0

路径 '/var/www/mtes/...' 无效,它是 Linux 上的 Web 根目录。Azure 应用程序上的 Web 根目录是 wwwroot,当您迁移到 Azure 应用程序时,您可能需要更改配置和应用程序设置以指向正确的 Web 根目录。如果您有硬编码路径,则还需要在代码中更改它们。

于 2015-06-29T14:26:42.903 回答
-1

SoapFault 是一个 PHP 类,http ://php.net/manual/en/soapfault.soapfault.php ,对象 $fault 在创建时必须有 $faultcode 和 $faultstring,$faultactor、$detail、$faultname 和 $headerfault是可选的,默认为空。

您从异常中看到,$faultcode 是“soap:Server”,$faultstring 是“编排计划引发了异常”。

对于调试,您可以在 catch 语句中添加 var_dump($fault),它可以为您提供更多信息,例如 $faultactor、$detail、$faultname 和 $headerfault。

于 2015-06-26T16:39:51.817 回答