如何输入需要xml参数字符串的soap方法参数 [英] How do I input soap method parameter requiring xml parameter string

查看:779
本文介绍了如何输入需要xml参数字符串的soap方法参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

如果有人能帮助我,我将不胜感激。我需要从具有下面描述的soap请求的Web服务获得响应:



 <   soapenv:Envelope     xmlns:soapenv   =  http://schemas.xmlsoap.org/soap/envelope/     xmlns:quic   =  http://services.thedomain.com/theservice/ >  
< soapenv:标题/ >
< soapenv:Body >
< quic:GetBillers >
<! - 可选: - >
< quic:xmlParams > ; < ![CDATA [< SearchCriteria >
< TerminalId > 4pbl0001 < / TerminalId >
< / SearchCriteria > ]]> < / quic:xmlParams >
< / quic:GetBillers >
< / soapenv:正文 >
< / soapenv:Envelope >





我使用下面的代码进行同一个Web服务的另一个操作(不需要任何请求字段),我得到了正确的答案:

  $ client  =  new  SoapClient($ wsdl, array('  trace' => $ trace,'  exceptions' => $例外)); 
$ response = $ client-> GetBillerCategories();
var_dump($ response);





然而我遇到的问题是顶部显示的GetBillers请求,我我使用了与成功的GetBillerCategories相同的代码(添加了参数),但无法获得适当的响应。修改后的代码如下所示:



 $ xml_array [' < span class =code-string> TerminalId'] = '  4pbl0001'; 
$ xml_array [' CategoryId'] = 4 ;
$ client = new SoapClient($ wsdl,array(' trace' => $ trace,' exceptions' => $ exceptions));
$ response = $ client-> GetBillers($ xml_array);
var_dump($ response);





我得到的回复是:

 object(stdClass)#36(1){[  GetBillersResult] => ; string(144)  100018464014} 





而不是一长串名称,ID,产品和CategoryId 4的分蘖的其他细节。

我需要做什么才能获得完整的GetBillers响应?

我非常感谢您的协助。

解决方案

client = new SoapClient(


wsdl,array(' trace' =>


trace,' exceptions' = >

Hello,
I would be grateful if anyone can assist me. I need to get a response from a web service that has a soap request as described below among others:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:quic="http://services.thedomain.com/theservice/">
   <soapenv:Header/>
   <soapenv:Body>
      <quic:GetBillers>
         <!--Optional:-->
         <quic:xmlParams><![CDATA[<SearchCriteria>
<TerminalId>4pbl0001</TerminalId>
</SearchCriteria>]]></quic:xmlParams>
      </quic:GetBillers>
   </soapenv:Body>
</soapenv:Envelope>



I used the code below for another action (which does not need any request fields) of the same web service, and I got the correct response:

 $client = new SoapClient($wsdl,array('trace' => $trace, 'exceptions' => $exceptions));
   $response = $client->GetBillerCategories();
var_dump($response);



However the problem I have is that for the GetBillers request shown at the top, I used the same code (with the addition of arguments) as I did for the successful GetBillerCategories, but could not get an appropriate response. The modified code is shown below:

$xml_array['TerminalId'] = '4pbl0001';
$xml_array['CategoryId'] = 4;
$client = new SoapClient($wsdl,array('trace' => $trace, 'exceptions' => $exceptions));
$response = $client->GetBillers($xml_array);
var_dump($response);



The response I got was:

object(stdClass)#36 (1) { ["GetBillersResult"]=> string(144) "100018464014" }



instead of a long string of names, Ids, products and other details of the billers of CategoryId 4.
What do I need to do to get the full GetBillers response?
Your assistance would be highly appreciated.

解决方案

client = new SoapClient(


wsdl,array('trace' =>


trace, 'exceptions' =>


这篇关于如何输入需要xml参数字符串的soap方法参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆