en fin tengo un webservice que me devuelve este xml:
[XML]<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:microsoft-dynamics-schemas/codeunit/WSTrucksAut" targetNamespace="urn:microsoft-dynamics-schemas/codeunit/WSTrucksAut">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:microsoft-dynamics-schemas/codeunit/WSTrucksAut">
<element name="LoginCheck">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="user" type="string"/>
<element minOccurs="1" maxOccurs="1" name="password" type="string"/>
</sequence>
</complexType>
</element>
<element name="LoginCheck_Result">
<complexType>
<sequence/>
</complexType>
</element>
<element name="a45a45a45a45a45a45a45a45a45a45a45a45a45a45a4 5a45a45a45a45a45a45a45usuarios">
<complexType>
<sequence/>
</complexType>
</element>
<element name="a45a45a45a45a45a45a45a45a45a45a45a45a45a45a4 5a45a45a45a45a45a45a45usuarios_Result">
<complexType>
<sequence/>
</complexType>
</element>
<element name="ValidaUsuario">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="login" type="string"/>
<element minOccurs="1" maxOccurs="1" name="contrasena" type="string"/>
</sequence>
</complexType>
</element>
<element name="ValidaUsuario_Result">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="return_value" type="string"/>
</sequence>
</complexType>
</element>
<element name="ValidaUsuario2">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="login" type="string"/>
<element minOccurs="1" maxOccurs="1" name="contrasena" type="string"/>
<element minOccurs="1" maxOccurs="1" name="numCliente" type="string"/>
<element minOccurs="1" maxOccurs="1" name="empresa" type="string"/>
</sequence>
</complexType>
</element>
<element name="ValidaUsuario2_Result">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="return_value" type="boolean"/>
<element minOccurs="1" maxOccurs="1" name="numCliente" type="string"/>
<element minOccurs="1" maxOccurs="1" name="empresa" type="string"/>
</sequence>
</complexType>
</element>
<element name="RegenerarContrasena">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="email" type="string"/>
<element minOccurs="1" maxOccurs="1" name="nuevaContrasena" type="string"/>
</sequence>
</complexType>
</element>
<element name="RegenerarContrasena_Result">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="return_value" type="boolean"/>
<element minOccurs="1" maxOccurs="1" name="nuevaContrasena" type="string"/>
</sequence>
</complexType>
</element>
<element name="CambiarContrasena">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="login" type="string"/>
<element minOccurs="1" maxOccurs="1" name="contrasenaVieja" type="string"/>
<element minOccurs="1" maxOccurs="1" name="contrasenaNueva" type="string"/>
</sequence>
</complexType>
</element>
<element name="CambiarContrasena_Result">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="return_value" type="boolean"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="LoginCheck">
<part name="parameters" element="tns:LoginCheck"/>
</message>
<message name="LoginCheck_Result">
<part name="parameters" element="tns:LoginCheck_Result"/>
</message>
<message name="a45a45a45a45a45a45a45a45a45a45a45a45a45a45a4 5a45a45a45a45a45a45a45usuarios">
<part name="parameters" element="tns:a45a45a45a45a45a45a45a45a45a45a45a45a 45a45a45a45a45a45a45a45a45a45usuarios"/>
</message>
<message name="a45a45a45a45a45a45a45a45a45a45a45a45a45a45a4 5a45a45a45a45a45a45a45usuarios_Result">
<part name="parameters" element="tns:a45a45a45a45a45a45a45a45a45a45a45a45a 45a45a45a45a45a45a45a45a45a45usuarios_Result"/>
[/XML]
Y para que me cambie la contraseña le ghe montado este php:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="is-IS">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>NAV Web Service via PHP</title>
</head>
<body>
<?php
define('USERPWD','128.20.1.1\jconesa:jconesa'); // Sustituir xxx por la contraseña del servidor
include("NTLMStream.php");
include("NTLMSoapClient.php");
stream_wrapper_unregister('http');
stream_wrapper_register('http','NTLMStream') or die("Fallo al registrar protocolo");
$pageURL = 'http://128.20.1.1:7047/DynamicsNav/WS/1%20TPS-N_LAB/Codeunit/WSTrucksAut'; // El Web Service
$params = array();
$params["login"] = "JCONESA"; // param1 es el nombre el primer parámetro.
$params["contrasena"] = "abc";
$params["email"] = "[email protected]";
$params["nuevaContrasena"] = "";
$client = new NTLMSoapClient($pageURL);
stream_wrapper_restore('http');
$result = $client->RegenerarContrasena($params); // El método del Web Service
$func = $result->return_value;
echo $func;
die();
?>
</body>
</html>
hasta aqui bien. la ontraseña me la cambia pero el web service solo me devuel que la ha cambiado "1" o que no "0"
Aqui viene la pregunta!!!! que variable debo poner en el php para que me diga que contraseña ha regenerado (PD : la regeneración es aleatoria. solo quiero que me diga cual es)