Foros del Web » Programando para Internet » PHP »

Ayuda Con Web Service

Estas en el tema de Ayuda Con Web Service en el foro de PHP en Foros del Web. Buen dia, de antemano gracias por la atencion y/o ayuda. Estoy conectandome a un webservices el cual tiene la oepracion consultar con los siguientes parametros: ...
  #1 (permalink)  
Antiguo 16/07/2010, 19:34
 
Fecha de Ingreso: marzo-2003
Mensajes: 164
Antigüedad: 21 años, 1 mes
Puntos: 0
Ayuda Con Web Service

Buen dia, de antemano gracias por la atencion y/o ayuda.

Estoy conectandome a un webservices
el cual tiene la oepracion consultar con los siguientes parametros:
$Vec = array('idsus' => '8070037','clasus' => '77MSEe','tipoid' => '1','id' => '98663305','papellido' => 'escobar');

este es el codigo que implemente:

Código:
require_once('n/nusoap-0.9.5/lib/nusoap.php');

$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';

$client = new nusoap_client('http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl', 'wsdl',
						$proxyhost, $proxyport, $proxyusername, $proxypassword);
						
//&debug=1						
$err = $client->getError();
if ($err) {
	echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}

$Vec = array('idsus' => '8070037','clasus' => '77MSEe','tipoid' => '1','id' => '98663305','papellido' => 'escobar');
$call = 'consultar';

$result = $client->call($call, $Vec);

echo '<h2>Resultado</h2><pre>';
print_r($result);
echo '</pre>';


// Check for a fault
if ($client->fault) {
	echo '<h2>Fault</h2><pre>';
	print_r($result);
	echo '</pre>';
} else {
	// Check for errors
	$err = $client->getError();
	if ($err) {
		// Display the error
		echo '<h2>Error</h2><pre>' . $err . '</pre>';
	} else {
		// Display the result
		echo '<h2>Result</h2><pre>';
		print_r($result);
		echo '</pre>';
	}
}
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
Pero cuando lo ejecuto no me trae nada.

solo me muestra

Código HTML:
Resultado
Array
(
    [faultcode] => soapenv:Server.userException
    [faultstring] => java.lang.NullPointerException
    [detail] => Array
        (
            [hostname] => web-pruebas
        )

)
Fault
Array
(
    [faultcode] => soapenv:Server.userException
    [faultstring] => java.lang.NullPointerException
    [detail] => Array
        (
            [hostname] => web-pruebas
        )

)
Request
POST /dhws.demo/services/DHService HTTP/1.0
Host: 172.24.14.29:8080
User-Agent: NuSOAP/0.9.5 (1.123)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: ""
Content-Length: 809

<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns6580="http://ws.hc.dc.com"><SOAP-ENV:Body><ns6580:consultar xmlns:ns6580="http://ws.hc.dc.com"><idsus xsi:type="SOAP-ENC:string">8070037</idsus><clasus xsi:type="SOAP-ENC:string">77MSEe</clasus><tipoid xsi:type="SOAP-ENC:string">1</tipoid><id xsi:type="SOAP-ENC:string">98663305</id><papellido xsi:type="SOAP-ENC:string">escobar</papellido><paramFormulario xsi:nil="true" xsi:type="SOAP-ENC:string"/></ns6580:consultar></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=iso-8859-1
Date: Fri, 16 Jul 2010 02:04:47 GMT
Connection: close

<?xml version="1.0" encoding="ISO-8859-1"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>java.lang.NullPointerException</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">web-pruebas</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
Debug
2010-07-15 22:04:44.402436 nusoap_client: ctor wsdl=wsdl timeout=0 response_timeout=30
endpoint=string(58) "http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl"
2010-07-15 22:04:44.402721 nusoap_client: will use lazy evaluation of wsdl from http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl
2010-07-15 22:04:44.402899 nusoap_client: call: operation=consultar, namespace=http://tempuri.org, soapAction=, rpcParams=, style=rpc, use=encoded, endpointType=wsdl
params=array(5) {
  ["idsus"]=>
  string(7) "8070037"
  ["clasus"]=>
  string(6) "77MSEe"
  ["tipoid"]=>
  string(1) "1"
  ["id"]=>
  string(8) "98663305"
  ["papellido"]=>
  string(7) "escobar"
}
headers=bool(false)
2010-07-15 22:04:44.403113 nusoap_client: instantiating wsdl class with doc: http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl
2010-07-15 22:04:44.403306 wsdl: ctor wsdl= timeout=0 response_timeout=30
2010-07-15 22:04:44.403488 wsdl: parse and process WSDL path=
2010-07-15 22:04:44.403652 wsdl: setCredentials username= authtype= certRequest=
array(0) {
}
2010-07-15 22:04:44.403852 wsdl: parse and process WSDL path=http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl
2010-07-15 22:04:44.404003 wsdl: parse WSDL at path=http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl
2010-07-15 22:04:44.404157 wsdl: getting WSDL http(s) URL http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl
2010-07-15 22:04:44.404362 soap_transport_http: ctor url=http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl use_curl= curl_options:
array(0) {
}
2010-07-15 22:04:44.404577 soap_transport_http: parsed URL scheme = http
2010-07-15 22:04:44.404738 soap_transport_http: parsed URL host = 172.24.14.29
2010-07-15 22:04:44.404900 soap_transport_http: parsed URL port = 8080
2010-07-15 22:04:44.405060 soap_transport_http: parsed URL path = /dhws.demo/services/DHService
2010-07-15 22:04:44.405219 soap_transport_http: parsed URL query = wsdl
2010-07-15 22:04:44.405423 soap_transport_http: set header Host: 172.24.14.29:8080
2010-07-15 22:04:44.405598 soap_transport_http: set header User-Agent: NuSOAP/0.9.5 (1.123)
2010-07-15 22:04:44.405773 soap_transport_http: set header Accept-Encoding: gzip, deflate
2010-07-15 22:04:44.405934 soap_transport_http: set header Connection: close
2010-07-15 22:04:44.406097 soap_transport_http: entered send() with data of length: 0
2010-07-15 22:04:44.406256 soap_transport_http: connect connection_timeout 0, response_timeout 30, scheme http, host 172.24.14.29, port 8080
2010-07-15 22:04:44.406427 soap_transport_http: calling fsockopen with host 172.24.14.29 connection_timeout 0
2010-07-15 22:04:44.428380 soap_transport_http: set response timeout to 30
2010-07-15 22:04:44.428588 soap_transport_http: socket connected
2010-07-15 22:04:44.428767 soap_transport_http: HTTP request: GET /dhws.demo/services/DHService?wsdl HTTP/1.1
2010-07-15 22:04:44.429017 soap_transport_http: HTTP header: Host: 172.24.14.29:8080
2010-07-15 22:04:44.429172 soap_transport_http: HTTP header: User-Agent: NuSOAP/0.9.5 (1.123)
2010-07-15 22:04:44.429320 soap_transport_http: HTTP header: Accept-Encoding: gzip, deflate
2010-07-15 22:04:44.429468 soap_transport_http: HTTP header: Connection: close
2010-07-15 22:04:44.429889 soap_transport_http: wrote data to socket, length = 161
2010-07-15 22:04:44.471439 soap_transport_http: read line of 17 bytes: HTTP/1.1 200 OK
2010-07-15 22:04:44.471661 soap_transport_http: read line of 27 bytes: Server: Apache-Coyote/1.1
2010-07-15 22:04:44.471867 soap_transport_http: read line of 38 bytes: Content-Type: text/xml;charset=utf-8
2010-07-15 22:04:44.472064 soap_transport_http: read line of 37 bytes: Date: Fri, 16 Jul 2010 02:04:47 GMT
2010-07-15 22:04:44.472246 soap_transport_http: read line of 19 bytes: Connection: close
2010-07-15 22:04:44.472412 soap_transport_http: read line of 2 bytes: 
utilizo una herramienta llamada sopaui y me conecto al webservice y paso los mismo parametros y este funciona perfecto.

depronto alguien me podria colaborar o dar una luz sobre por que no esta funcionando.

de nuevo mil gracias y disculpen la molestia.
  #2 (permalink)  
Antiguo 28/07/2010, 23:47
 
Fecha de Ingreso: julio-2010
Mensajes: 19
Antigüedad: 13 años, 8 meses
Puntos: 0
Respuesta: Ayuda Con Web Service

Hola se ve bien

tienes que usar un proxi para conectarte al webservices?

tienes el xml para verlo completo.?

saludos
  #3 (permalink)  
Antiguo 03/08/2010, 06:50
 
Fecha de Ingreso: marzo-2003
Mensajes: 164
Antigüedad: 21 años, 1 mes
Puntos: 0
Respuesta: Ayuda Con Web Service

Buen dia Rabernet, te agradezco la atencion y ayuda, en la isguienet ur te dejo el archivo que entrega como resultado.

http://cid-a5374b5fb1ef1ea7.skydrive...GetSharingLink
es este el que me pides, o te envio el wsdl que genera el soapui

de nuevo mil gracias
  #4 (permalink)  
Antiguo 04/08/2010, 15:19
 
Fecha de Ingreso: julio-2010
Mensajes: 19
Antigüedad: 13 años, 8 meses
Puntos: 0
Respuesta: Ayuda Con Web Service

intenta actualizar el nusoap a 1.123 o superior no tengo ahora links de descarga.

y te envio algo modificado haber si funciona.

Código PHP:
require_once('lib/nusoap.php');

$client = new nusoap_client('http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl' 'wsdl');


$Vec = array(
'idsus' => '8070037',
'clasus' => '77MSEe',
'tipoid' => '1',
'id' => '98663305',
'papellido' => 'escobar'
);

$result $client->call('consultar'$Vec);

echo 
'<h2>Resultado</h2><pre>';
print_r($result);
echo 
'</pre>';


// Check for a fault
if ($client->fault) {
    echo 
'<h2>Fault</h2><pre>';
    
print_r($result);
    echo 
'</pre>';
} else {
    
// Check for errors
    
$err $client->getError();
    if (
$err) {
        
// Display the error
        
echo '<h2>Error</h2><pre>' $err '</pre>';
    } else {
        
// Display the result
        
echo '<h2>Result</h2><pre>';
        
print_r($result);
        echo 
'</pre>';
    }
}
echo 
'<h2>Request</h2><pre>' htmlspecialchars($client->requestENT_QUOTES) . '</pre>';
echo 
'<h2>Response</h2><pre>' htmlspecialchars($client->responseENT_QUOTES) . '</pre>';
echo 
'<h2>Debug</h2><pre>' htmlspecialchars($client->debug_strENT_QUOTES) . '</pre>'
Hazlo asi y me cuentas que te responde ..

saludos
  #5 (permalink)  
Antiguo 09/08/2010, 15:20
 
Fecha de Ingreso: marzo-2003
Mensajes: 164
Antigüedad: 21 años, 1 mes
Puntos: 0
Respuesta: Ayuda Con Web Service

Buen dia Rabernet.
graciasde neuvo por tu colaboracion, revise las versiones de nusoap y ninguna esta por enciam de 1


aun me presenta el error, te lo anexo.

http://cid-a5374b5fb1ef1ea7.skydrive...GetSharingLink


de neuvo gracias en lo que me puedas colaborar
  #6 (permalink)  
Antiguo 11/08/2010, 10:30
 
Fecha de Ingreso: julio-2010
Mensajes: 19
Antigüedad: 13 años, 8 meses
Puntos: 0
Respuesta: Ayuda Con Web Service

si entras a esta pagina te debe de cargar un xml

http://172.24.14.29:8080/dhws.demo/services/DHService?wsdl

me lo envias..
y lo reviso
  #7 (permalink)  
Antiguo 11/08/2010, 12:51
 
Fecha de Ingreso: marzo-2003
Mensajes: 164
Antigüedad: 21 años, 1 mes
Puntos: 0
Respuesta: Ayuda Con Web Service

Buen dia Rabernet, mil gracias de nuevo por tu colaboracion, esta es la url

http://cid-a5374b5fb1ef1ea7.skydrive...GetSharingLink
el xml se llama dhservice

Etiquetas: service
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:05.