0
Apache 2.2.32上的PHP 5.6.30没有正确生成空变量
我试图用SoapClient拨打电话。请求结构中的一个类具有很多属性,其中大多数属性必须以xsi:nil="true"
发送。下面是一个例子
class myClass {
public $attribute1;
public $attribute2;
public $attribute3;
}
一个简单的类时,我发送请求的XML而不设定任何(或空的所有属性)如下生成(跳过SOAP-ENV和等):
<ns1:class>
<ns1:attribute1 xsi:nil="true">
<ns1:attribute2 xsi:nil="true">
<ns1:attribute3 xsi:nil="true"></ns1:attribute3>
</ns1:attribute2>
</ns1:attribute1>
</ns1:class>
我期望是
<ns1:class>
<ns1:attribute1 xsi:nil="true" />
<ns1:attribute2 xsi:nil="true" />
<ns1:attribute3 xsi:nil="true" />
</ns1:class>
如果我分配一个值,可以说attribute2那么XML就会产生这样:
<ns1:class>
<ns1:attribute1 xsi:nil="true">
<ns1:attribute2>my_value</ns1:attribute2>
<ns1:attribute3 xsi:nil="true"></ns1:attribute3>
</ns1:attribute1>
</ns1:class>
很明显,远程服务器不接受我的请求!
对这个问题有什么想法?
顺便说一句我没有提供WSDL,因为我首先必须要求权限。
谢谢
你需要显示你的代码。你能否用所有专有名称取代WSDL的版本? – Barmar