I'm working on a Webservice using PHP SoapClient.
The webservice url is: http://web.abaseguros.com/AutoConnect/ACCatalogos.svc?wsdl
And here is my code:
<?php
ini_set("soap.wsdl_cache_enabled", "0");
$pin = new SoapClient("http://web.abaseguros.com/AutoConnect/ACCatalogos.svc?wsdl");
class Token {
var $usuario;
var $password;
function Token($user,$pass) {
$this->usuario = $user;
$this->password = $pass;
}
}
//User and Password for the token object
$Token = new Token('usuarioWCF','Pa$$w0rd');
//XML 'Entrada' String
$Entrada = "<CAT><NEG>5786</NEG></CAT>";
$result = $pin->ObtenerMarcas($Token,$Entrada);
But PHP prints out the following error message:
Fatal error: Uncaught SoapFault exception: [a:DeserializationFailed] when i execute the script.
The company gave me a sample code written on C#
private void Obtener_Catalogo_ABASeguros()
{
string strEntrada, strSalida;
strEntrada = “<CAT><NEG>5786</NEG></CAT>“; +
ACCatalogosClient proxy = new ACCatalogosClient();
Token token = new Token();
token.usuario = "usuarioWCF";
token.password = "Pa$$w0rd";
try
{
strSalida = proxy.ObtenerMarcas(token, strEntrada);
}
catch (FaultException<Error> ex)
{
txtCotSalida.Text = string.Format("Ocurrio un error en el WCF:\n " +
"Origen: {0}\n "+
"Mensaje: {1}\n "+
"Stack: {2}", ex.Detail.Origen, ex.Detail.Mensaje, ex.Detail.StackTrace);
}
But I'm still unabled to understand how parameters are sent on both languages.
Any Help?