您好我从eway代币支付api集成中收到此错误。
SoapFault异常:[HTTP]错误请求
当我运行以下代码,然后运行soap中的函数
var_dump($client->__getFunctions());
和功能列表是
array
0 => string 'CreateCustomerResponse CreateCustomer(CreateCustomer $parameters)' (length=65)
1 => string 'UpdateCustomerResponse UpdateCustomer(UpdateCustomer $parameters)' (length=65)
2 => string 'QueryCustomerResponse QueryCustomer(QueryCustomer $parameters)' (length=62)
3 => string 'QueryCustomerByReferenceResponse QueryCustomerByReference(QueryCustomerByReference $parameters)' (length=95)
4 => string 'ProcessPaymentResponse ProcessPayment(ProcessPayment $parameters)' (length=65)
5 => string 'ProcessPaymentWithCVNResponse ProcessPaymentWithCVN(ProcessPaymentWithCVN $parameters)' (length=86)
6 => string 'ProcessPaymentWithBeagleResponse ProcessPaymentWithBeagle(ProcessPaymentWithBeagle $parameters)' (length=95)
7 => string 'QueryPaymentResponse QueryPayment(QueryPayment $parameters)' (length=59)
8 => string 'CreateCustomerResponse CreateCustomer(CreateCustomer $parameters)' (length=65)
9 => string 'UpdateCustomerResponse UpdateCustomer(UpdateCustomer $parameters)' (length=65)
10 => string 'QueryCustomerResponse QueryCustomer(QueryCustomer $parameters)' (length=62)
11 => string 'QueryCustomerByReferenceResponse QueryCustomerByReference(QueryCustomerByReference $parameters)' (length=95)
12 => string 'ProcessPaymentResponse ProcessPayment(ProcessPayment $parameters)' (length=65)
13 => string 'ProcessPaymentWithCVNResponse ProcessPaymentWithCVN(ProcessPaymentWithCVN $parameters)' (length=86)
14 => string 'ProcessPaymentWithBeagleResponse ProcessPaymentWithBeagle(ProcessPaymentWithBeagle $parameters)' (length=95)
15 => string 'QueryPaymentResponse QueryPayment(QueryPayment $parameters)' (length=59)
当我像这样调用这个函数时
$client->CreateCustomer($customerinfo);
然后它给我一个错误SoapFault异常:[HTTP]错误请求。
$ customerinfo是所有数据的数组。
答案 0 :(得分:0)
这可能与您在$parameters
数组中传递的数据有关。确保您的数据符合SOAP
,并且您的请求也是如此。当SOAP处理器无法理解请求时,会发生HTTP 400
。
编码在数据发送和接收中起着重要作用。如果有效负载具有非SOAP编码部分,则可能导致这种情况。如果您可以在CreateCustomer()
中记录请求,则可以验证请求。
根据上述事情进行故障排除,希望您能解决问题。如果您可以更清楚,更详细地发布您的问题,也会有所帮助