如何从SoapClient解析Struct - > __ getTypes()?

时间:2016-04-25 15:35:47

标签: php parsing soap struct

我试图使用getTypes()来解析WSDL的类型:

$wsdl  = 'http://wwwh1.tjrj.jus.br/HMNI/Servico.svc?singleWsdl';
$client = new SoapClient($wsdl);
$types = $client->__getTypes();
foreach($types as $type){
   var_dump($type);
}

然而,结果就是“字符串”:

string 'struct tipoConsultarAvisosPendentes {
 string idRepresentado;
 string idConsultante;
 string senhaConsultante;
 string dataReferencia;
}' (length=136)

我想获得每个属性(及其类型)。 还有另一种解析类型的方法吗?

提前致谢!

2 个答案:

答案 0 :(得分:1)

由于已经8个月了,你可能不再需要它了。 在这种情况下发布给其他任何人。

我个人使用此工具wsdl2phpgenerator

如果只需要,可以检查源代码并提取解析类型的部分。

答案 1 :(得分:0)

最后我做了我自己:

language: python
python:
  - "3.5"
  - "3.6"
  - "3.7"
os: linux
dist: bionic
install: skip
before_script:
  - python -c 'import os, virtualenv; virtualenv.install_distutils(os.environ["VIRTUAL_ENV"])'
script:
  - python -W error::DeprecationWarning -c 'import distutils'