php soap客户端生成异常

时间:2015-03-13 04:40:20

标签: php validation object serialization gsoap

我有一个php客户端和一个基于gsoap(linux)的服务。当调用其中一个方法(服务)时,我得到以下异常:

验证约束违规:在元素'env:Envelope'

中缺少ref#ref1的id

错误围绕调用中表示复杂参数的单个参数。这个参数的基础是下面wsdl中显示的'array-data'。

以下是相关的wsdl:

  <complexType name="data-elem">
   <sequence>
     <element name="name" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
     <element name="list" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
     <element name="length" type="xsd:int" minOccurs="1" maxOccurs="1"/>
     <element name="stype" type="xsd:int" minOccurs="1" maxOccurs="1"/>
     <element name="dtype" type="xsd:int" minOccurs="1" maxOccurs="1"/>
     <element name="permission" type="xsd:int" minOccurs="1" maxOccurs="1"/>
     <element name="message" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
    <choice>
     <element name="cdata" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
     <element name="idata" type="xsd:int" minOccurs="1" maxOccurs="1"/>
     <element name="fdata" type="xsd:float" minOccurs="1" maxOccurs="1"/>
     <element name="ddata" type="xsd:double" minOccurs="1" maxOccurs="1"/>
    </choice>
   </sequence>
  </complexType>
  <complexType name="data">
   <sequence>
     <element name="elems" type="ns:data-elem" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
  </complexType>
  <complexType name="array-data">
   <sequence>
     <element name="records" type="ns:data" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>

以下是此参数的传递数据:

stdClass Object ( [records] => Array ( [0] => stdClass Object ( [elems] => Array ( [0] => stdClass Object ( [name] => SERVICE.d01 [list] => [length] => 15 [stype] => 1 [dtype] => 0 [permission] => 3 [message] => [cdata] => gerry@yohoo.com ) [1] => stdClass Object ( [name] => SERVICE.servdef [list] => [length] => 0 [stype] => 3 [dtype] => 0 [permission] => 1 [message] => [idata] => 3 ) ) ) [1] => stdClass Object ( [elems] => Array ( [0] => stdClass Object ( [name] => SERVICE.d01 [list] => [length] => 15 [stype] => 1 [dtype] => 0 [permission] => 3 [message] => [cdata] => gerry@yohoo.com ) [1] => stdClass Object ( [name] => SERVICE.servdef [list] => [length] => 0 [stype] => 3 [dtype] => 0 [permission] => 1 [message] => [idata] => 3 ) ) ) ) )

我不完全确定传递的数据是否符合架构,但如果我传递一个“records”数组,则服务调用可以正常工作。

单个数组示例如下所示:

stdClass Object ( [records] => Array ( [0] => stdClass Object ( [elems] => Array ( [0] => stdClass Object ( [name] => SERVICE.d01 [list] => [length] => 15 [stype] => 1 [dtype] => 0 [permission] => 3 [message] => [cdata] => gerry@yohoo.com ) [1] => stdClass Object ( [name] => SERVICE.servdef [list] => [length] => 0 [stype] => 3 [dtype] => 0 [permission] => 1 [message] => [idata] => 2 ) ) ) ) )

错误完全由php客户端验证生成。服务器永远不会被调用。

有人有任何指示或建议吗?我错过了什么?我可以提供哪些其他数据来帮助解答这个问题?如何调试?

0 个答案:

没有答案