Use SPC webservices

0

Hello everyone. I'm trying to get the web service method, but it prints the following result:

Array
(
    [faultcode] => S:Client
    [faultstring] => org.xml.sax.SAXParseException; cvc-elt.1: Cannot find the declaration of element 'ns7603:buscarPF'.
)

Connection code

<?php

require_once 'lib/nusoap.php';

$wsdl = 'https://treina.spc.org.br/spc/remoting/ws/consulta/buscaWebService?wsdl';

$client = new nusoap_client($wsdl);
$client->setCredentials(utf8_encode('xxx'), utf8_encode('xxx'));
$result = $client->call(utf8_encode('buscarPF'));

echo '<pre>';
print_r($result);
echo '</pre>';
?>

XML

<definitions targetNamespace="http://webservice.consulta.spcjava.spcbrasil.org/" name="buscaWebService"><types><xsd:schema><xsd:import namespace="http://webservice.consulta.spcjava.spcbrasil.org/" schemaLocation="https://treina.spc.org.br:443/spc/remoting/ws/consulta/buscaWebService?xsd=1"/></xsd:schema></types><message name="buscarPF"><part name="filtroBuscaPF" element="tns:filtroBuscaPF"/></message><message name="buscarPFResponse"><part name="resultadoBuscaPF" element="tns:resultadoBuscaPF"/></message><message name="buscarPJ"><part name="filtroBuscaPJ" element="tns:filtroBuscaPJ"/></message><message name="buscarPJResponse"><part name="resultadoBuscaPJ" element="tns:resultadoBuscaPJ"/></message><portType name="buscaWebService"><operation name="buscarPF"><input wsam:Action="http://webservice.consulta.spcjava.spcbrasil.org/buscaWebService/buscarPFRequest" message="tns:buscarPF"/><output wsam:Action="http://webservice.consulta.spcjava.spcbrasil.org/buscaWebService/buscarPFResponse" message="tns:buscarPFResponse"/></operation><operation name="buscarPJ"><input wsam:Action="http://webservice.consulta.spcjava.spcbrasil.org/buscaWebService/buscarPJRequest" message="tns:buscarPJ"/><output wsam:Action="http://webservice.consulta.spcjava.spcbrasil.org/buscaWebService/buscarPJResponse" message="tns:buscarPJResponse"/></operation></portType><binding name="buscaWebServicePortBinding" type="tns:buscaWebService"><soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><operation name="buscarPF"><soap:operation soapAction=""/><input><soap:body use="literal"/></input><output><soap:body use="literal"/></output></operation><operation name="buscarPJ"><soap:operation soapAction=""/><input><soap:body use="literal"/></input><output><soap:body use="literal"/></output></operation></binding><service name="buscaWebService"><port name="buscaWebServicePort" binding="tns:buscaWebServicePortBinding"><soap:address location="https://treina.spc.org.br:443/spc/remoting/ws/consulta/buscaWebService"/></port></service></definitions>
    
asked by anonymous 10.10.2018 / 03:49

0 answers