簡體   English   中英

SOAP:HTTP錯誤請求

[英]SOAP: HTTP Bad Request

我的網站在Windows azure網絡應用程序上。 我正在使用下面的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,錯誤字符串:Bad Request

不知道是什么意思 如果您需要更多信息,請與我們聯系。 謝謝。

堆棧跟蹤

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}

路徑“ / var / www / mtes / ...”無效,它是Linux上的Web根目錄。 Azure Apps上的Web根是wwwroot,當您遷移到Azure Apps時,可能需要更改配置和應用程序設置以指向正確的Web根。 如果您具有硬編碼的路徑,則還需要在代碼中進行更改。

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。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM