0
能有人幫助我解決這個問題,這是我的PHP代碼中,我試圖在XML從Web服務獲取信息整合PHP,SoapClient的,XML
$cliente = newSoapClient("http://000.000.000.000/uat_abbott_service/AbbottService.svc?wsdl", array("trace" => 1, "exception" => 0));
$parametros_entCredencial = array();
$parametros_entCredencial['Login'] = 'PAGUE';
$parametros_entCredencial['Password'] = 'P4gu3';
$parametros_entCredencial['SucursalId'] = '1';
$parametros_entCredencial['SucursalCaja'] = '11';
$parametros_entCredencial['EmpleadoId'] = '22222';
$parametros_entPaciente = array();
$parametros_entPaciente['Documento'] = '9837720122';
$parametros_entPaciente['Tarjeta'] = '';
$parametros_ValidarPaciente = array();
$parametros_ValidarPaciente = array_merge($parametros_entCredencial, $parametros_entPaciente);
$parametros_ValidarPaciente = (object)$parametros_ValidarPaciente;
var_dump($parametros_ValidarPaciente);
echo "<br />";
$respuesta = $cliente->ValidarPaciente($parametros_ValidarPaciente);
var_dump($respuesta);
echo "<br />";
echo "Last Request<br />";
var_dump($cliente->__getLastRequest());
echo "Last answer<br />";
var_dump($cliente->__getLastResponse());
echo "end<br />";
我可以連接到網絡服務,但是在我的代碼中有一個問題,總是響應是「對象沒有實例化」,__getLastRequest總是空的... 我該如何索取這個...?
感謝
另外... 當我得到functios和類型
功能
ValidarPacienteResponse ValidarPaciente(ValidarPaciente $parameters)
CotizarVentaResponse CotizarVenta(CotizarVenta $parameters)
ConfirmarVentaResponse ConfirmarVenta(ConfirmarVenta $parameters)
ValidarCancelacionResponse ValidarCancelacion(ValidarCancelacion $parameters)
CancelarVentaResponse CancelarVenta(CancelarVenta $parameters)
ConciliarVentaResponse ConciliarVenta(ConciliarVenta $parameters)
ConciliarCancelacionResponse ConciliarCancelacion(ConciliarCancelacion $parameters)
類型
struct entCredencial { string Login; string Password; string SucursalId;
string SucursalCaja; string EmpleadoId; }
struct entPaciente { string Documento; string Tarjeta; }
struct entToken { string Token; entMensaje Mensaje; }
struct entMensaje { short Codigo; }
struct ArrayOfentMedicamento { entMedicamento entMedicamento; }
struct entMedicamento { string Codigo; string CodigoDeBarras; int Cantidad; }
struct entCotizacion { string Id; entMensaje Mensaje; entCompra Compra; entSugerenciaCompra SugerenciaCompra; }
struct entCompra { ArrayOfentMedicamentoCompra Medicamentos; }
struct ArrayOfentMedicamentoCompra { entMedicamentoCompra entMedicamentoCompra; }
struct entMedicamentoCompra { string IdentificadorCompra; entMedicamento Medicamento; ArrayOfentBeneficio Beneficios; }
struct ArrayOfentBeneficio { entBeneficio entBeneficio; }
struct entBeneficio { string IdentificadorCompra; string Codigo; string CodigoDeBarras; int Cantidad; boolean Entregado; }
struct entSugerenciaCompra { ArrayOfentMedicamentoCompra Medicamentos; }
struct entTransaccion { string IdConfirmacion; string Ticket; entMensaje Mensaje; }
struct entCancelacion { entToken Token; ArrayOfentMedicamentoCompra Medicamentos; }
struct ValidarPaciente { entCredencial usuario; entPaciente paciente; }
struct ValidarPacienteResponse { entToken ValidarPacienteResult; }
struct CotizarVenta { entToken token; ArrayOfentMedicamento medicamentos; }
struct CotizarVentaResponse { entCotizacion CotizarVentaResult; }
struct ConfirmarVenta { entToken token; string ticket; entCotizacion cotizacion; }
struct ConfirmarVentaResponse { entTransaccion ConfirmarVentaResult; }
struct ValidarCancelacion { entCredencial usuario; entTransaccion transaccion; }
struct ValidarCancelacionResponse { entCancelacion ValidarCancelacionResult; }
struct CancelarVenta { entToken token; entTransaccion transaccion; }
struct CancelarVentaResponse { entTransaccion CancelarVentaResult; }
struct ConciliarVenta { entCredencial usuario; string ticket; }
struct ConciliarVentaResponse { entTransaccion ConciliarVentaResult; }
struct ConciliarCancelacion { entCredencial usuario; string ticket; }
struct ConciliarCancelacionResponse { entTransaccion ConciliarCancelacionResult; }
試試這個驗證您的WSDL 的var_dump功能($客戶端 - > __ getTypes()); –
這是涉及函數的所有函數和類型 ValidarPacienteResponse ValidarPaciente(ValidarPaciente $參數) 類型 struct entCredencial {string Login;字符串密碼;字符串SucursalId;字符串SucursalCaja;字符串EmpleadoId; } struct ValidarPaciente {entCredencial usuario; entPaciente paciente; } struct entPaciente {string Documento;字符串Tarjeta; } – iohan