PHP SoapClient SoapParam 子变量?
我对我的 PHP SoapClient 请求有疑问...
如何制作子参数?我给出了更多信息的示例
这是我的 xml: ...
<ns1:GetPackInfo>
<UserName xsi:type="xsd:string">xxx</UserName>
<Password xsi:type="xsd:string">xxx</Password>
<PackInfo xsi:type="ns2:TPackInfo"/>
...
我需要将子参数放入 PackInfo- 示例:
<ns1:GetPackInfo>
<UserName xsi:type="xsd:string">xxx</UserName>
<Password xsi:type="xsd:string">xxx</Password>
<PackInfo xsi:type="ns2:TPackInfo">
<PackCode xsi:type="xsd:string">60000</PackCode>
</PackInfo>
怎么做?
我用:
class Soap extends SoapClient
{
const url = 'https://..../wsdl/... example';
function __construct()
{
$url = self::url;
parent::__construct($url, array(
'soap_version' => SOAP_1_1,
'encoding' => 'utf-8',
'trace' => true,
'connection_timeout' => 900,
'cache_wsdl' => WSDL_CACHE_NONE
));
}
...
try
{
//service requirements
$user = new SoapParam('xxx', "UserName");
$pass = new SoapParam('xxx', "Password");
$result = $this->$method_name($user, $pass, $params);
i have a question about one my PHP SoapClient request...
how to make sub params? I give example for more information
This is my xml:
...
<ns1:GetPackInfo>
<UserName xsi:type="xsd:string">xxx</UserName>
<Password xsi:type="xsd:string">xxx</Password>
<PackInfo xsi:type="ns2:TPackInfo"/>
...
I need to put sub parameters in PackInfo- example :
<ns1:GetPackInfo>
<UserName xsi:type="xsd:string">xxx</UserName>
<Password xsi:type="xsd:string">xxx</Password>
<PackInfo xsi:type="ns2:TPackInfo">
<PackCode xsi:type="xsd:string">60000</PackCode>
</PackInfo>
How to do it?
I use :
class Soap extends SoapClient
{
const url = 'https://..../wsdl/... example';
function __construct()
{
$url = self::url;
parent::__construct($url, array(
'soap_version' => SOAP_1_1,
'encoding' => 'utf-8',
'trace' => true,
'connection_timeout' => 900,
'cache_wsdl' => WSDL_CACHE_NONE
));
}
...
try
{
//service requirements
$user = new SoapParam('xxx', "UserName");
$pass = new SoapParam('xxx', "Password");
$result = $this->$method_name($user, $pass, $params);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论