Jump to content


Photo

Webservice Retornar Matriz


  • Faça o login para participar
Nenhuma resposta neste tópico

#1 lfbadwolf

lfbadwolf

    Turista

  • Usuários
  • 54 posts
  • Sexo:Não informado
  • Localidade:Rio Branco - AC

Posted 30/03/2008, 10:09

Yenho o seguinte serviço de webservice

$server->configureWSDL('server.listarEmail','urn:server.listarEmail');
$server->wsdl->schemaTargetNamespace = 'urn:server.listarEmail';
$server->wsdl->addComplexType(
  'returnListar',
  'complexType',
  'struct',
  'all',
  '',
  array(
	'listausuarioid' => array('name' => 'listausuarioid', 'type' => 'xsd:int'),
	'lista_listaid' => array('name' => 'lista_listaid', 'type' => 'xsd:int'),
	'listausuarionome' => array('name' => 'listausuarionome', 'type' => 'xsd:string'),
	'listausuarioemail' => array('name' => 'listausuarioemail', 'type' => 'xsd:string'),
	'listausuariostatus'  => array('name' => 'listausuariostatus',  'type' => 'xsd:string')
  )
);


$server->register('listarEmail', //nome do método
array('intIdLista' => 'xsd:integer', ), //parâmetros de entrada
array('return' => 'tns:returnListar'), //parâmetros de saída
'urn:server.listarEmail', //namespace
'urn:server.listarEmail#listarEmail', //soapaction
'rpc', //style
'encoded', //use
'Listar Email' //documentação do serviço
);



function listarEmail($intIdLista) 
{
	$objConexao			= new Conexao();
	$objBancoDeDados	= new BancoDeDados();
	$objLista			= new Lista();
	
	$lnkConn		= $objConexao->conectarBancoDados();
	if(!empty($intIdLista))
	{
		$arrEmail = $objLista->listarEmailListaPorListaId($intIdLista,'',0,10);			
	}
	else
	{
		$arrEmail[0]['listausuarioid'] = '0';
		$arrEmail[0]['listausuarioemail'] = 'Erro';
	}
	return $arrEmail;
}



O retorno é de uma matriz, atpé agora só conseguir retornar vetor,.

Tem como retornar matriz via ws?

Edição feita por: boirock, 30/03/2008, 22:33.
Uso de [code]

Luiz Felipe programador PHP e ASP
Email: lfbaio@wasolucoes.com.br
Site: www.wasolucoes.com.br




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq