gpt4 book ai didi

PHP SOAP 客户端错误

转载 作者:可可西里 更新时间:2023-11-01 13:22:55 24 4
gpt4 key购买 nike

我收到这个奇怪的错误“值不能为空。参数名称:输入”但是没有名称为“输入”的参数。

我尝试过更改代码并尝试使用它,但我认为这里缺少一些简单的东西(多年未使用 SOAP)。

<?php

$xmlData = '<LoanRequest><VendorId>20</VendorId>
<SubVendorId>0</SubVendorId>
<Tier>Dynamic</Tier>
<FirstName>TestFname</FirstName>
<LastName>TestLname</LastName>
<DateOfBirth>1979-03-09</DateOfBirth>
<Title>Mr</Title>
<Postcode>SO164LN</Postcode>
<HouseNumber>98</HouseNumber>
<Street>Test Street</Street>
<Town>Test Town</Town>
<County>Test County</County>
<HomeOwner>False</HomeOwner>
<HomePhone>02300000000</HomePhone>
<WorkPhone>02000000000</WorkPhone>
<MobilePhone>0799123321</MobilePhone>
<Email>pdbuktest@pbuk.com</Email>
<IncomeSource>5</IncomeSource>
<EmployerName>PDB Test</EmployerName>
<TimeWithEmployer>48</TimeWithEmployer>
<PaidByDirectDeposit>1</PaidByDirectDeposit>
<NetMonthlyIncome>1700</NetMonthlyIncome>
<PayFrequency>3</PayFrequency>
<NextPayDay>2013-05-31</NextPayDay>
<PaydayAfterNext>2013-06-07</PaydayAfterNext>
<DebitCard>VD</DebitCard>
<BankAccountNumber>12345678</BankAccountNumber>
<BankSortCode>9987655</BankSortCode>
<NIN></NIN>
<LoanAmount>500</LoanAmount>
<IPAddress>127.0.0.1</IPAddress>
<Consent>1</Consent>
<TimeAtAddressYears>2</TimeAtAddressYears>
<TimeAtAddressMonths>3</TimeAtAddressMonths>
<UserAgent>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)</UserAgent>
<LoanPurpose>Car</LoanPurpose>
<Pricequote>10</Pricequote>
<HousingExpenditure>100</HousingExpenditure>
<CreditExpenditure>150</CreditExpenditure>
<OtherExpenditure>220</OtherExpenditure></LoanRequest>';

$url = 'http://www.pdbuk.co.uk/API/loan.asmx?wsdl';
$options["location"] = $url;
$options['trace'] = 1;

$client = new SoapClient($url, $options);
$result = $client->SendRequest($xmlData);
var_dump($result);
?>

我做错了什么?谢谢!

最佳答案

应该传递的 XML 数据应该是数组而不是字符串(基于 WSDL)。所以这会起作用:

$result = $client->SendRequest(array('inpXml' => $xmlData));

关于PHP SOAP 客户端错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18077362/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com