ArrayOf_apachesoap_Element数据类型的php web服务客户端使用wsdl2php


ArrayOf_apachesoap_Element datatype for php web service client using wsdl2php

我正在用PHP编写一个web服务客户端。Web服务是使用axis用Java开发的。客户端代理使用wsdl2php工具生成。代理代码包括以下代码

class ValidateDetails {
  public $elements; // ArrayOf_apachesoap_Element
  public $pipeName; // string
}

和参数设置,并使用以下代码

调用服务
$xml = '<elements> <some xml here />    </elements>';
$xmlElement = new DOMElement('elements', $xml, '');
$details = new ValidateDetails();
$details->elements[0] =  $xmlElement;
$details->pipeName = 'mypipe';

$response = new ValidationResult();
$response = $client->validate($details);
但是SoapRequest对象不包含元素节点内嵌套的xml。它看起来像这样
<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://build.nomos.com" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="urn:CompilationService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:validate>
<details xsi:type="ns3:ValidateDetails">
<elements SOAP-ENC:arrayType="ns2:Element[1]" xsi:type="ns3:ArrayOf_apachesoap_Element">
<item xsi:type="SOAP-ENC:Struct"/>
</elements>

<pipeName xsi:type="xsd:string">mypipe</pipeName>
</details></ns1:validate></SOAP-ENV:Body></SOAP-ENV:Envelope> 

我无法理解如何用正确的xml填充元素字段。请建议这个ArrayOf_apachesoap_Element数据类型是什么,以及我如何填充这个参数。

显然没有这种数据类型转换的解决方案,或者至少我不知道这种数据类型。如果您可以访问主机web服务

,请尝试使用标准数据类型,例如字符串。