我一直试图调用在java 中创建的bajaj webservice(不向我共享,也不能从他们身边更改),它应该将响应作为PDF文件的字节数组返回,我想要通过PHP代码调用它,但它总是给我一个错误如下:
方法参数:return不能为null。这是违反BP 1.1 R2211的行为。
对于调用Web服务,我使用过Soap Client和w.s.d.l链接,如下所示:
wsdl = http://webservicesdev.bajajallianz.com/docDownldWS/WebServiceImplService?wsdl
在尝试调用soap-> __ getFunctions()时,我收到了以下内容:
Array
(
[0] => anyType downloadFile(clientInfo $arg0)
[1] => anyType getPolicyDoc(string $arg0, string $arg1)
[2] => anyType getPolicyPdf(base64Binary $arg0, string $arg1)
)
在尝试致电soap->__getTypes()
时,我得到了回复:
Array
(
[0] => struct clientInfo {
string errorCode;
string errorMsg;
string password;
string pdfMode;
string policyNum;
string str1;
string str10;
string str11;
string str12;
string str13;
string str14;
string str15;
string str2;
string str3;
string str4;
string str5;
string str6;
string str7;
string str8;
string str9;
string userId;
}
)
请帮我解决问题。我甚至尝试过创建 struct object 但是它导致了同样的问题。 我做了以下实验:
<?php
class clientInfo {
public $errorCode='';
public $errorMsg='';
public $password='somepass';
public $pdfMode='WS_POLICY_PDF';
public $policyNum='OG-18-9906-8430-00001806';
public $str1='';
public $str10='';
public $str11='';
public $str12='';
public $str13='';
public $str14='';
public $str15='';
public $str2='';
public $str3='';
public $str4='';
public $str5='';
public $str6='';
public $str7='';
public $str8='';
public $str9='';
public $userId='itsTheirUserName@s.in';
}
$clientInfo = new clientInfo();
try {
$soap = new SoapClient($wsdl, $options);
$data = $soap->downloadFile(array(0=>$clientInfo));
print_r($data);die;
}
catch(Exception $e) {
die($e->getMessage()); }
?>