dousou3027 2016-01-22 12:32
浏览 167

SOAP PHP返回数据

can any Coding Gurus lend a helping hand,

I make the following soap call:

    $acc = 192838;

$vec1 = array(
        'USERNAME'=>'test',
        'PASSWORD'=>'test',
        'BRANCHID'=>231,
    'Customer_AccountNo'=>$acc
  );

    $soap_client = new SoapClient('https://test.com/externalintegration.asmx?WSDL');
    $info = $soap_client->Get_CustomerInfo($vec1);

var_dump($info);

Which returns the following data:

object(stdClass)#2 (1) { ["Get_CustomerInfoResult"]=> object(stdClass)#3 (2) { ["schema"]=> string(4205) "" ["any"]=> string(2419) "192838ADELW7210250821972-10-03T00:00:00+02:00ENGLISHFEMALESINGLE6 CARWELL STREET, HIGHS RIVERCAPE TOWN3REET, HIGBURY PKUILS RIRCAPE a@s.com076478680707647868070219804897YES2015-06-04T12:55:02.49+02:00DISPUTED216LIT9AMSRAMSGAT90039 314 9090CAPITEC BANK470010AD Wentzel116056ARDINE LPSON SA1ST FLOOR, BUILDING 3, FUSON QUTER,s s s s AFRICA744102155113140215511314ilay@jlto.comSHANTAL PILLAY1Employeyed2518970.00003000.0000CLATOS " } }

The data is being returned in one string, but I need to access the individual information.

Firstnames

Surname

IdentityNo

Email

etc..

Thanks in advance for your help!

WSDL:

<s:element name="Get_CustomerInfo">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="USERNAME" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="PASSWORD" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="BRANCHID" type="s:long"/>
<s:element minOccurs="1" maxOccurs="1" name="Customer_AccountNo" type="s:long"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Get_CustomerInfoResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Get_CustomerInfoResult">
<s:complexType>
<s:sequence>
<s:element ref="s:schema"/>
<s:any/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
  • 写回答

1条回答 默认 最新

  • dongyan4424 2017-01-12 05:59
    关注

    Maybe you should try a WSDL to PHP generator in order to have a real PHP object in return and not a stdClass. Maybe the returned string will be converted to another PHP object that will be more convenient. Try with the PackageGenerator so you'll have a PHP SDK using the native PHP SoapClient class and a tutorial file as a starting guide.

    In addition, maybe you have to pass an additional parameter in your request that specify the format of the data you want. The generated PHP SDK will show you this sort of thing maybe.

    评论

报告相同问题?

悬赏问题

  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题