Webservice CEP

Enviada por Cézar Ayran 
Cézar Ayran
Webservice CEP
03 de July de 2013 às 08:45AM
Caros,

Criei este pequeno webservice para consulta e retornos de dados de CEP dos correios base de Novembro/2012, as informações são gratuitas e podem ser acessadas em:

http://www.appnet.com.br/cep/?cep=49047-000

O formato inicial é em JSONP podendo ser adicionado outros (a comunidade irá colaborar)

Segue abaixo um exemplo com javascript para teste:

<SCRIPT type="text/javascript" src="http://www.plugmania.com.br/js/jquery.js"></SCRIPT>
<script type="text/javascript">
function getEndereco() {
if($.trim($("#cep").val()) != ""){
$.getScript("http://www.appnet.com.br/cep/?cep="+$("#cep").val(), function(){

if(resultadoCEP["resultado"] == "1"){
$("#endereco").val(unescape(resultadoCEP["logradouro"])+" "+unescape(resultadoCEP["endereco"]));
$("#cidade").val(unescape(resultadoCEP["cidade"]));
$("#bairro").val(unescape(resultadoCEP["bairro"]));
$("#estado").val(unescape(resultadoCEP["uf"]));
}else{
$("#endereco").val("");
$("#cidade").val("");
$("#bairro").val("");
$("#estado").val("");
alert('Este CEP não está em nosso banco de dados, preencha-o manualmente.');
}// fim if se deu certo
});
}
}
</script>

<table width="706" border="0">
<tr>
<td width="137">CEP</td>
<td colspan="3"><input type="text" name="cep" id="cep" value="" maxlength="9" size="9"/> <input type="button" value="CHECAR" onclick="getEndereco()" /></td>
</tr>
<tr>
<td>ENDEREÇO/Nº</td>
<td colspan="3"><input type="text" name="endereco" id="endereco" value="" maxlength="100" size="40"/>
<div style="float:left; margin-top:8px;">/</div>
<input type="text" name="numero" id="numero" value="" maxlength="5" size="5"/></td>
</tr>
<tr>
<td>COMPLEMENTO</td>
<td colspan="3"><input type="text" name="complemento" id="complemento" value="" maxlength="100" size="40"/></td>
</tr>
<tr>
<td>Ponto de Referência</td>
<td colspan="3"><input type="text" size="40" maxlength="100" value="" id="pontoReferencia" name="pontoReferencia"></td>
</tr>
<tr>
<td>ESTADO</td>
<td width="191"><input type="text" name="estado" id="estado"></td>
<td width="79">CIDADE</td>
<td width="281"><input type="text" name="cidade" id="cidade"></td>
</tr>
<tr>
<td>BAIRRO</td>
<td colspan="3"><input type="text" name="bairro" id="bairro"></td>
</tr>
</table>
Lucas Tiago de Moraes
Re: Webservice CEP
03 de July de 2013 às 01:41PM
Eu ainda prefiro baixar o banco de CEP. Existe muitos vantagens, a principal é o desempenho. Eu também uso em muito sistema em off.
Cézar Ayran
Re: Webservice CEP
14 de December de 2013 às 05:43PM
Atenção: Venho informar que tive de bloquear a utilização do webservice de CEP. Há pouco tive uma sobrecarga na CPU por mal uso do mesmo. Agora para utilizá-lo será necessário um cadastro e uma senha deverá ser passada via URL quando for consultado.

Interessados enviar e-mail com Nome completo, telefone, URL do site, onde o webservice será utilizado para falecom@appnet.com.br
Eduardo Molina
Re: Webservice CEP
28 de December de 2016 às 01:11PM
Eu utilizo este em minhas aplicações.

https://viacep.com.br
tiago
Re: Webservice CEP
04 de May de 2017 às 07:15PM
ola gostaria de uma ajuda tenho o seguinte codigo para consumir um webservice, o problema é que nao tenho o retorno



tenho que encaminhar este envelope em xml

<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:udmDados-IdmDados" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:requisicao> <XML xsi:type="xsd:string">&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;requisicao in_schema="F"&gt; &lt;loginws cd_loginws="shopparanaws" cd_senhaws="582347" /&gt; &lt;pessoa acao="con" nr_cpfcnpj="87698595900" /&gt; &lt;/requisicao&gt;</XML> </ns1:requisicao> </SOAP-ENV:Body> </SOAP-ENV:Envelope>



<?php
require_once('lib/nusoap.php');
$url = "http://186.251.24.59/wbsStoreage/VirtualWsServer.exe/soap/IdmDados";
$args = ('<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:udmDados-IdmDados" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:requisicao> <XML xsi:type="xsd:string">&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;requisicao in_schema="F"&gt; &lt;loginws cd_loginws="shopparanaws" cd_senhaws="582347" /&gt; &lt;pessoa acao="con" nr_cpfcnpj="87698595900" /&gt; &lt;/requisicao&gt;</XML> </ns1:requisicao> </SOAP-ENV:Body> </SOAP-ENV:Envelope>');

$client = new nusoap_client($url);
// Error check
$err = $client->getError();
if ($err) {
// Show error
echo '<h2>Error with soapclient creation: </h2><pre>' . $err . '</pre>';
// call won't work
}

$result = $client->call('teste', array($args));

if ($client->fault) {

// Manage error

}
echo "<p>Value returned from the server is: " . $result . "</p>";

echo '<h2>Request</h2>';

echo '<pre>'.htmlspecialchars($client->request, ENT_QUOTES).'</pre>';

echo '<h2>Response</h2>';

echo '<pre>'.htmlspecialchars($client->response, ENT_QUOTES).'</pre>';

echo '<h2>Debug</h2>';

echo '<pre>'.htmlspecialchars($client->debug_str, ENT_QUOTES).'</pre>';

?>







obtenho o seguinte


Notice: Array to string conversion in D:\xampp\htdocs\paranapark\7\1.php on line 23
Value returned from the server is: Array

Request

POST /wbsStoreage/VirtualWsServer.exe/soap/IdmDados HTTP/1.0
Host: 186.251.24.59
User-Agent: NuSOAP/0.9.5 (1.123)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: ""
Content-Length: 1476

<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns8524:teste xmlns:ns8524="http://tempuri.org"><__numeric_0 xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:ns1=&quot;urn:udmDados-IdmDados&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&gt; &lt;SOAP-ENV:Body&gt; &lt;ns1:requisicao&gt; &lt;XML xsi:type=&quot;xsd:string&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt; &amp;lt;requisicao in_schema=&quot;F&quot;&amp;gt; &amp;lt;loginws cd_loginws=&quot;shopparanaws&quot; cd_senhaws=&quot;582347&quot; /&amp;gt; &amp;lt;pessoa acao=&quot;con&quot; nr_cpfcnpj=&quot;87698595900&quot; /&amp;gt; &amp;lt;/requisicao&amp;gt;&lt;/XML&gt; &lt;/ns1:requisicao&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt;</__numeric_0></ns8524:teste></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response

HTTP/1.1 200 OK
Date: Fri, 05 May 2017 00:06:29 GMT
Server: Apache/2.2.22 (Win32)
Content:
Content-Length: 483
Connection: close
Content-Type: text/xml

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultactor/><faultcode>SOAP-ENV:Server</faultcode><faultstring>No method named 'teste' is supported by interface 'IdmDados'</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Debug

2017-05-05 02:06:25.996622 nusoap_client: ctor wsdl= timeout=0 response_timeout=30
endpoint=string(66) "http://186.251.24.59/wbsStoreage/VirtualWsServer.exe/soap/IdmDados"
2017-05-05 02:06:25.996622 nusoap_client: instantiate SOAP with endpoint at http://186.251.24.59/wbsStoreage/VirtualWsServer.exe/soap/IdmDados
2017-05-05 02:06:25.996622 nusoap_client: call: operation=teste, namespace=http://tempuri.org, soapAction=, rpcParams=, style=rpc, use=encoded, endpointType=soap
params=array(1) {
[0]=>
string(713) "<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:udmDados-IdmDados" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:requisicao> <XML xsi:type="xsd:string">&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;requisicao in_schema="F"&gt; &lt;loginws cd_loginws="shopparanaws" cd_senhaws="582347" /&gt; &lt;pessoa acao="con" nr_cpfcnpj="87698595900" /&gt; &lt;/requisicao&gt;</XML> </ns1:requisicao> </SOAP-ENV:Body> </SOAP-ENV:Envelope>"
}
headers=bool(false)
2017-05-05 02:06:25.996622 nusoap_client: serializing param array for operation teste
2017-05-05 02:06:25.996622 nusoap_client: in serialize_val: name=0, type=, name_ns=, type_ns=, use=encoded, soapval=
value=string(713) "<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:udmDados-IdmDados" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:requisicao> <XML xsi:type="xsd:string">&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;requisicao in_schema="F"&gt; &lt;loginws cd_loginws="shopparanaws" cd_senhaws="582347" /&gt; &lt;pessoa acao="con" nr_cpfcnpj="87698595900" /&gt; &lt;/requisicao&gt;</XML> </ns1:requisicao> </SOAP-ENV:Body> </SOAP-ENV:Envelope>"
attributes=bool(false)
2017-05-05 02:06:25.996622 nusoap_client: serialize_val: serialize string
2017-05-05 02:06:25.996622 nusoap_client: serialize_val returning <__numeric_0 xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:ns1=&quot;urn:udmDados-IdmDados&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&gt; &lt;SOAP-ENV:Body&gt; &lt;ns1:requisicao&gt; &lt;XML xsi:type=&quot;xsd:string&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt; &amp;lt;requisicao in_schema=&quot;F&quot;&amp;gt; &amp;lt;loginws cd_loginws=&quot;shopparanaws&quot; cd_senhaws=&quot;582347&quot; /&amp;gt; &amp;lt;pessoa acao=&quot;con&quot; nr_cpfcnpj=&quot;87698595900&quot; /&amp;gt; &amp;lt;/requisicao&amp;gt;&lt;/XML&gt; &lt;/ns1:requisicao&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt;</__numeric_0>
2017-05-05 02:06:25.996622 nusoap_client: wrapping RPC request with encoded method element
2017-05-05 02:06:25.996622 nusoap_client: In serializeEnvelope length=1079 body (max 1000 characters)=<ns8524:teste xmlns:ns8524="http://tempuri.org"><__numeric_0 xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:ns1=&quot;urn:udmDados-IdmDados&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&gt; &lt;SOAP-ENV:Body&gt; &lt;ns1:requisicao&gt; &lt;XML xsi:type=&quot;xsd:string&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt; &amp;lt;requisicao in_schema=&quot;F&quot;&amp;gt; &amp;lt;loginws cd_loginws=&quot;shopparanaws&quot; cd_senhaws=&quot;582347&quot; /&amp;gt; &amp;lt;pessoa acao=&quot;con&quot; nr_cpfcnpj=&quot;87698595900&quot; /&amp;gt; &amp;lt;/requisicao&amp;gt;&lt;/XML&gt; &lt;/ns1:requisicao&gt; style=rpc use=encoded encodingStyle=http://schemas.xmlsoap.org/soap/encoding/
2017-05-05 02:06:25.996622 nusoap_client: headers:
bool(false)
2017-05-05 02:06:25.996622 nusoap_client: namespaces:
array(0) {
}
2017-05-05 02:06:25.996622 nusoap_client: endpoint=http://186.251.24.59/wbsStoreage/VirtualWsServer.exe/soap/IdmDados, soapAction=, namespace=http://tempuri.org, style=rpc, use=encoded, encodingStyle=http://schemas.xmlsoap.org/soap/encoding/
2017-05-05 02:06:25.996622 nusoap_client: SOAP message length=1476 contents (max 1000 bytes)=<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns8524:teste xmlns:ns8524="http://tempuri.org"><__numeric_0 xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:ns1=&quot;urn:udmDados-IdmDados&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&gt; &lt;SOAP-ENV:Body&gt; &lt;ns1:requisicao&gt; &lt;XML xsi:type=&quot;xsd:string&quot;&gt
2017-05-05 02:06:25.996622 nusoap_client: transporting via HTTP
2017-05-05 02:06:25.996622 nusoap_client: sending message, length=1476
2017-05-05 02:06:25.996622 soap_transport_http: ctor url=http://186.251.24.59/wbsStoreage/VirtualWsServer.exe/soap/IdmDados use_curl= curl_options:
array(0) {
}
2017-05-05 02:06:25.996622 soap_transport_http: parsed URL scheme = http
2017-05-05 02:06:25.996622 soap_transport_http: parsed URL host = 186.251.24.59
2017-05-05 02:06:25.996622 soap_transport_http: parsed URL path = /wbsStoreage/VirtualWsServer.exe/soap/IdmDados
2017-05-05 02:06:25.996622 soap_transport_http: set header Host: 186.251.24.59
2017-05-05 02:06:25.996622 soap_transport_http: set header User-Agent: NuSOAP/0.9.5 (1.123)
2017-05-05 02:06:25.996622 soap_transport_http: set header Content-Type: text/xml; charset=ISO-8859-1
2017-05-05 02:06:25.996622 soap_transport_http: set header SOAPAction: ""
2017-05-05 02:06:25.996622 soap_transport_http: entered send() with data of length: 1476
2017-05-05 02:06:25.996622 soap_transport_http: connect connection_timeout 0, response_timeout 30, scheme http, host 186.251.24.59, port 80
2017-05-05 02:06:25.996622 soap_transport_http: calling fsockopen with host 186.251.24.59 connection_timeout 0
2017-05-05 02:06:29.054242 soap_transport_http: set response timeout to 30
2017-05-05 02:06:29.054242 soap_transport_http: socket connected
2017-05-05 02:06:29.054242 soap_transport_http: set header Content-Length: 1476
2017-05-05 02:06:29.054242 soap_transport_http: HTTP request: POST /wbsStoreage/VirtualWsServer.exe/soap/IdmDados HTTP/1.0
2017-05-05 02:06:29.054242 soap_transport_http: HTTP header: Host: 186.251.24.59
2017-05-05 02:06:29.054242 soap_transport_http: HTTP header: User-Agent: NuSOAP/0.9.5 (1.123)
2017-05-05 02:06:29.054242 soap_transport_http: HTTP header: Content-Type: text/xml; charset=ISO-8859-1
2017-05-05 02:06:29.054242 soap_transport_http: HTTP header: SOAPAction: ""
2017-05-05 02:06:29.054242 soap_transport_http: HTTP header: Content-Length: 1476
2017-05-05 02:06:29.054242 soap_transport_http: wrote data to socket, length = 1677
2017-05-05 02:06:29.194643 soap_transport_http: read line of 17 bytes: HTTP/1.1 200 OK
2017-05-05 02:06:29.194643 soap_transport_http: read line of 37 bytes: Date: Fri, 05 May 2017 00:06:29 GMT
2017-05-05 02:06:29.194643 soap_transport_http: read line of 31 bytes: Server: Apache/2.2.22 (Win32)
2017-05-05 02:06:29.194643 soap_transport_http: read line of 11 bytes: Content:
2017-05-05 02:06:29.194643 soap_transport_http: read line of 21 bytes: Content-Length: 483
2017-05-05 02:06:29.194643 soap_transport_http: read line of 19 bytes: Connection: close
2017-05-05 02:06:29.194643 soap_transport_http: read line of 24 bytes: Content-Type: text/xml
2017-05-05 02:06:29.194643 soap_transport_http: read line of 2 bytes:
2017-05-05 02:06:29.194643 soap_transport_http: found end of headers after length 162
2017-05-05 02:06:29.194643 soap_transport_http: want to read content of length 483
2017-05-05 02:06:29.194643 soap_transport_http: read buffer of 483 bytes
2017-05-05 02:06:29.194643 soap_transport_http: read body of length 483
2017-05-05 02:06:29.194643 soap_transport_http: received a total of 645 bytes of data from server
2017-05-05 02:06:29.194643 soap_transport_http: closed socket
2017-05-05 02:06:29.194643 soap_transport_http: No Content-Encoding header
2017-05-05 02:06:29.194643 soap_transport_http: end of send()
2017-05-05 02:06:29.194643 nusoap_client: got response, length=483 type=text/xml
2017-05-05 02:06:29.194643 nusoap_client: Entering parseResponse() for data of length 483 headers:
array(6) {
["date"]=>
string(29) "Fri, 05 May 2017 00:06:29 GMT"
["server"]=>
string(21) "Apache/2.2.22 (Win32)"
["content"]=>
string(0) ""
["content-length"]=>
string(3) "483"
["connection"]=>
string(5) "close"
["content-type"]=>
string(8) "text/xml"
}
2017-05-05 02:06:29.194643 nusoap_client: Use encoding: ISO-8859-1 when creating nusoap_parser
2017-05-05 02:06:29.194643 nusoap_parser: No encoding specified in XML declaration
2017-05-05 02:06:29.194643 nusoap_parser: Entering nusoap_parser(), length=483, encoding=ISO-8859-1
2017-05-05 02:06:29.194643 nusoap_parser: found root struct Fault, pos 2
2017-05-05 02:06:29.194643 nusoap_parser: in buildVal() for Fault(pos 2) of type struct
2017-05-05 02:06:29.194643 nusoap_parser: in buildVal, there are children
2017-05-05 02:06:29.194643 nusoap_parser: in buildVal, adding Java Vector or generic compound type Fault
2017-05-05 02:06:29.194643 nusoap_parser: in buildVal, return:
array(3) {
["faultactor"]=>
&string(0) ""
["faultcode"]=>
&string(15) "SOAP-ENV:Server"
["faultstring"]=>
&string(60) "No method named 'teste' is supported by interface 'IdmDados'"
}
2017-05-05 02:06:29.194643 nusoap_parser: in nusoap_parser ctor, message:
array(6) {
[0]=>
array(9) {
["pos"]=>
int(0)
["children"]=>
string(2) "|1"
["cdata"]=>
string(0) ""
["depth"]=>
int(0)
["parent"]=>
string(0) ""
["status"]=>
string(8) "envelope"
["name"]=>
string(8) "Envelope"
["attrs"]=>
array(4) {
["xmlns:SOAP-ENV"]=>
string(41) "http://schemas.xmlsoap.org/soap/envelope/"
["xmlns:xsd"]=>
string(32) "http://www.w3.org/2001/XMLSchema"
["xmlns:xsi"]=>
string(41) "http://www.w3.org/2001/XMLSchema-instance"
["xmlns:SOAP-ENC"]=>
string(41) "http://schemas.xmlsoap.org/soap/encoding/"
}
["namespace"]=>
string(41) "http://schemas.xmlsoap.org/soap/envelope/"
}
[1]=>
array(9) {
["pos"]=>
int(1)
["children"]=>
string(2) "|2"
["cdata"]=>
string(0) ""
["depth"]=>
int(1)
["parent"]=>
int(0)
["status"]=>
string(4) "body"
["name"]=>
string(4) "Body"
["attrs"]=>
array(0) {
}
["namespace"]=>
string(41) "http://schemas.xmlsoap.org/soap/envelope/"
}
[2]=>
array(11) {
["pos"]=>
int(2)
["children"]=>
string(6) "|3|4|5"
["cdata"]=>
string(0) ""
["depth"]=>
int(2)
["parent"]=>
int(1)
["type"]=>
string(6) "struct"
["status"]=>
string(6) "method"
["name"]=>
string(5) "Fault"
["attrs"]=>
array(0) {
}
["namespace"]=>
string(41) "http://schemas.xmlsoap.org/soap/envelope/"
["result"]=>
array(3) {
["faultactor"]=>
&string(0) ""
["faultcode"]=>
&string(15) "SOAP-ENV:Server"
["faultstring"]=>
&string(60) "No method named 'teste' is supported by interface 'IdmDados'"
}
}
[3]=>
array(10) {
["pos"]=>
int(3)
["children"]=>
string(0) ""
["cdata"]=>
string(0) ""
["depth"]=>
int(3)
["parent"]=>
int(2)
["status"]=>
string(6) "method"
["name"]=>
string(10) "faultactor"
["attrs"]=>
array(0) {
}
["namespace"]=>
string(41) "http://schemas.xmlsoap.org/soap/envelope/"
["result"]=>
&string(0) ""
}
[4]=>
array(10) {
["pos"]=>
int(4)
["children"]=>
string(0) ""
["cdata"]=>
string(15) "SOAP-ENV:Server"
["depth"]=>
int(3)
["parent"]=>
int(2)
["status"]=>
string(6) "method"
["name"]=>
string(9) "faultcode"
["attrs"]=>
array(0) {
}
["namespace"]=>
string(41) "http://schemas.xmlsoap.org/soap/envelope/"
["result"]=>
&string(15) "SOAP-ENV:Server"
}
[5]=>
array(10) {
["pos"]=>
int(5)
["children"]=>
string(0) ""
["cdata"]=>
string(60) "No method named 'teste' is supported by interface 'IdmDados'"
["depth"]=>
int(3)
["parent"]=>
int(2)
["status"]=>
string(6) "method"
["name"]=>
string(11) "faultstring"
["attrs"]=>
array(0) {
}
["namespace"]=>
string(41) "http://schemas.xmlsoap.org/soap/envelope/"
["result"]=>
&string(60) "No method named 'teste' is supported by interface 'IdmDados'"
}
}
2017-05-05 02:06:29.194643 nusoap_parser: parsed successfully, found root struct: 2 of name Fault
2017-05-05 02:06:29.194643 nusoap_client: sent message successfully and got a(n) array
return=array(3) {
["faultactor"]=>
string(0) ""
["faultcode"]=>
string(15) "SOAP-ENV:Server"
["faultstring"]=>
string(60) "No method named 'teste' is supported by interface 'IdmDados'"
}
2017-05-05 02:06:29.194643 nusoap_client: got fault
2017-05-05 02:06:29.194643 nusoap_client: faultactor = <br>
2017-05-05 02:06:29.194643 nusoap_client: faultcode = SOAP-ENV:Server<br>
2017-05-05 02:06:29.194643 nusoap_client: faultstring = No method named 'teste' is supported by interface 'IdmDados'<br>
Você precisa estar logado no PHPBrasil.com para poder enviar mensagens para os nossos fóruns.

Faça o login aqui.