How to consume this soapclient webservice in php?

Asked

Viewed 135 times

0

inserir a descrição da imagem aqui

How to consume this soapclient webservice in php ??? tried the code below and gave the following error.

Code

$client = new SoapClient('http://www.smsviaweb.com.br/SMSVIAWEB.asmx?wsdl');
  $params = array('Login'    => 'xxxxx', 'Senha'    => 'xxxxx','Telefone'=>'xxxxx', 'Mensagem'=>'xxxxx');
  $client->__soapCall("Envia", $params);

Error

Fatal error: Uncaught Soapfault Exception: [Soap:Server] System.Web.Services.Protocols.Soapexception: Server was Unable to process request. ---> System.Nullreferenceexception: Object Reference not set to an instance of an Object. at SMSVIAWEB.Sends(Objmsgsmsvw Objmsg) --- End of Inner Exception stack trace ---

getFunctions

 array(6) {
  [0]=>
  string(38) "EnviaResponse Envia(Envia $parameters)"
  [1]=>
  string(50) "EnviaLoteResponse EnviaLote(EnviaLote $parameters)"
  [2]=>
  string(62) "ExecutaImportResponse ExecutaImport(ExecutaImport $parameters)"
  [3]=>
  string(38) "EnviaResponse Envia(Envia $parameters)"
  [4]=>
  string(50) "EnviaLoteResponse EnviaLote(EnviaLote $parameters)"
  [5]=>
  string(62) "ExecutaImportResponse ExecutaImport(ExecutaImport $parameters)"
}
array(9) {
  [0]=>
  string(37) "struct Envia {
 OBJMsgSMSVW OBJMsg;
}"
  [1]=>
  string(127) "struct OBJMsgSMSVW {
 string Login;
 string Senha;
 string IDCliente;
 string Telefone;
 string Mensagem;
 string DataAgenda;
}"
  • Better define exactly what you want.. Want the code to connect the client to the web service?

  • @Andrey that’s right.

  • 1

    Okay, try to do it yourself first.... if you can’t, post what you tried and the community will show you how to improve/adjust the code. I’m just showing you how to use the site, don’t get me wrong.

  • @Andrey thanks for the help.. I tried and still it wasn’t. I’ll post the code

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.