简体   繁体   English

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

[英]ArrayOf_apachesoap_Element datatype for php web service client using wsdl2php

I am writing a web service client in PHP.我正在 PHP 中编写一个 web 服务客户端。 web service is developed ij java using axis. web 服务是使用轴开发的 ij java。 Client proxy is generated using wsdl2php tool.客户端代理是使用 wsdl2php 工具生成的。 Proxy code include the following code代理代码包括以下代码

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

and the parameters are set and service is called using the following code并设置参数并使用以下代码调用服务

$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);

However the SoapRequest object does not contain the nested xml inside the element node.但是,SoapRequest object 不包含元素节点内的嵌套 xml。 It looks like this看起来像这样

<?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> 

I am unable to understand how to populate the elements field with the correct xml.我无法理解如何使用正确的 xml 填充元素字段。 Please suggest what is this ArrayOf_apachesoap_Element datatype and how can i populate this parameter.请建议这个ArrayOf_apachesoap_Element数据类型是什么以及如何填充这个参数。

Apparently there is no solution for such kind of data type conversions, or at least i am not aware of this datatype.显然这种数据类型转换没有解决方案,或者至少我不知道这种数据类型。 try to use standard data types such as string, if you have access to the host web service如果您有权访问主机 web 服务,请尝试使用标准数据类型,例如字符串

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM