简体   繁体   English

SOAP:HTTP错误请求

[英]SOAP: HTTP Bad Request

My website is on windows azure web-app. 我的网站在Windows azure网络应用程序上。 I am using below SOAP message. 我正在使用下面的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}");
}

And it's giving me this fault message : 这给了我这个fault message

fault code: HTTP, fault string: Bad Request 错误代码:HTTP,错误字符串:Bad Request

I don't know what does it mean? 不知道是什么意思 Let me know if you need more information. 如果您需要更多信息,请与我们联系。 Thanks. 谢谢。

Stack Trace 堆栈跟踪

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}

The path '/var/www/mtes/...' is not valid, it is the web root on Linux. 路径“ / var / www / mtes / ...”无效,它是Linux上的Web根目录。 Web root on Azure Apps is wwwroot, when you migrate to Azure Apps, you may need to change configuration, and application settings to point to correct web root. Azure Apps上的Web根是wwwroot,当您迁移到Azure Apps时,可能需要更改配置和应用程序设置以指向正确的Web根。 If you have hard coded paths, you need to change them in code as well. 如果您具有硬编码的路径,则还需要在代码中进行更改。

SoapFault is a PHP class, http://php.net/manual/en/soapfault.soapfault.php , the object $fault must have $faultcode and $faultstring when created, $faultactor, $detail , $faultname, and $headerfault are optional, default to empty. SoapFault是一个PHP类, http: //php.net/manual/en/soapfault.soapfault.php,对象$ fault在创建时必须具有$ faultcode和$ faultstring,$ faultactor,$ detail,$ faultname和$ headerfault是可选的,默认为空。

What you see from exception, $faultcode is "soap:Server", $faultstring is "An exception is thrown by the Orchestration schedule". 从异常中可以看到,$ faultcode是“ soap:Server”,$ faultstring是“编排计划抛出了异常”。

For debugging, you can add var_dump($fault) in catch statement, it could provide you more info, such as $faultactor, $detail , $faultname, and $headerfault. 为了进行调试,您可以在catch语句中添加var_dump($ fault),它可以为您提供更多信息,例如$ faultactor,$ detail,$ faultname和$ headerfault。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM