[英]NuSOAP + PHP , wsdl error: XML error parsing WSDL issue
I'm trying to use nuSOAP to send a array with some data that will be use it on DB, but every time i get this "wsdl error: XML error parsing WSDL issue ... not well-formed (invalid token)" on my client.php 我正在尝试使用nuSOAP发送带有一些数据的数组,该数组将在DB上使用它,但是每次我收到此“ wsdl错误:解析WSDL问题的XML错误...格式不正确(无效的令牌)”时,我的client.php
Here is my a little of my code on the server : 这是我在服务器上的一些代码:
$server->register('cadastrar',
array('dados'=>'tns:cadastro'),
array('return'=>'xsd:string'),
$namespace,
$namespace.'#cadastrar',
'rpc',
'encoded',
''
);
$server->wsdl->addComplexType('cadastrar', 'complexType', 'struct', 'all','',
array(
'empresa' =>array ('name'=>'empresa','type'=>'xsd:string')
,'nome' =>array ('name'=>'nome','type'=>'xsd:string')
,'email' =>array ('name'=>'email','type'=>'xsd:string')
,'ddd' =>array ('name'=>'ddd','type'=>'xsd:string')
,'tel' =>array ('name'=>'tel','type'=>'xsd:string')
,'msg' =>array ('name'=>'msg','type'=>'xsd:string')
)
);
function cadastrar($dados){
//$objCliente = new Cliente();
//if($objCliente)
//$id = $objCliente->cadastroWebService($dados);
return $dados['empresa'];
}
and this is my code on the client : 这是我在客户端上的代码:
$dados = array(
'empresa' => $_POST['empresa'],
'nome' => $_POST['nome'],
'email' => $_POST['email'],
'ddd' => $_POST['ddd'],
'tel' => $_POST['tel'],
'msg' => $_POST['msg']
);
//Chama o metodo call do SOAP
$result = $client->call('cadastrar', array('cadastro'=> $dados));
Anybody got any idea why isn't working ? 任何人都知道为什么不工作吗?
Thanks 谢谢
I found what i was doing wrong when i was iniciating the client i was missing some arguments... 当我吸引客户时,我发现我做错了什么,我错过了一些争论...
$client = new nusoap_client('http://www.domain.com/server.php?wsdl&debug=1', 'wsdl');
I just put the wsdl&debug=1', 'wsdl'
and it work it 我只是把wsdl&debug=1', 'wsdl'
放上wsdl&debug=1', 'wsdl'
可以了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.