English 中文(简体)
PHP 肥皂用量未正确将函数参数包含在 XML 中
原标题:PHP SoapClient fails to include function-params in XML properly

我试图对一个名为 GetPeriodicValues 的.NET WSDL 函数提出请求。 该函数需要一些参数, 问题在于肥皂服务创建错误的 XML 。

这个PHP代码...

$client = new SoapClient(self::URL , array( trace  => 1,   encoding  =>  UTF-8 ,  soap_version  => SOAP_1_1));
$params = array( name  =>  myname ,  address  =>  myaddress );
$result = $client->__soapCall( GetPeriodicValues , array( parameters  => $params), array());

...通过下列请求-XML(我排除了一些不相关的内容):

<SOAP-ENV:Body>
   <ns1:RequestOf_GetPeriodicValuesParameters/>
</SOAP-ENV:Body>

但我希望它能创造这个

<SOAP-ENV:Body>
   <ns1:RequestOf_GetPeriodicValuesParameters>
      <ns1:name>myname</ns1:name>
      <ns1:address>myaddress</ns1:address>
   </ns1:RequestOf_GetPeriodicValuesParameters>
</SOAP-ENV:Body>

我应如何将参数纳入功能调用中?

最佳回答

问题解决了。 我学到的是, XML 产出取决于 WSDL, 而对于我来说,它想要我用关键“ Params ” 将参数放在一个阵列中。 但是,看看 WSDL 的 XML 返回,我没有发现这样的信息, 相反,它看起来像关键“ 参数” 应该使用。 我不确定, 但服务也许有问题 。

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签