Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/12/2009, 18:25
Avatar de solinem
solinem
 
Fecha de Ingreso: diciembre-2007
Mensajes: 61
Antigüedad: 16 años, 4 meses
Puntos: 0
Respuesta: WSDL no se despliega

Perdón por la omisión
El archivo WSDL es solo una parte de todo el servicio web, a continuación pongo el código del archivo "catalog.wsdl"
Código:
<?xml version ='1.0' encoding ='UTF-8'?>
<definitions name='Catalog' 
  targetNamespace='http://example.org/catalog'  
  xmlns:tns=' http://example.org/catalog '  
  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'  
  xmlns:xsd='http://www.w3.org/2001/XMLSchema'  
  xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'  
  xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' 
  xmlns='http://schemas.xmlsoap.org/wsdl/'> 
   <message name='getCatalogRequest'> 
     <part name='catalogId' type='xsd:string'/> 
   </message> 
   <message name='getCatalogResponse'> 
     <part name='Result' type='xsd:string'/> 
   </message> 
   <portType name='CatalogPortType'> 
     <operation name='getCatalogEntry'> 
      <input message='tns:getCatalogRequest'/> 
      <output message='tns:getCatalogResponse'/> 
     </operation> 
   </portType> 
   <binding name='CatalogBinding' type='tns:CatalogPortType'> 
     <soap:binding style='rpc' 
      transport='http://schemas.xmlsoap.org/soap/http'/> 
     <operation name='getCatalogEntry'> 
      <soap:operation soapAction='urn:localhost-catalog#getCatalogEntry'/> 
      <input> 
        <soap:body use='encoded' namespace='urn:localhost-catalog'
          encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
      </input> 
      <output> 
        <soap:body use='encoded' namespace='urn:localhost-catalog' 
          encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
      </output> 
     </operation> 
   </binding> 
   <service name='CatalogService'> 
     <port name='CatalogPort' binding='CatalogBinding'> 
      <soap:address location='http://localhost/ws/soap-server.php'/>
     </port> 
   </service>
</definitions>
El código del servidor "soap-server.php"
Código:
<?php 
function getCatalogEntry($catalogId) { 
  if($catalogId=='catalog1')
return '<?xml version="1.0"?>
<reservation_response><order><code>GDLA4E-37</code><date>2009-12-06</date><package>100% TEQUILA Y AVENTURA&gt; EL AGUACATILLO</package><total>3366</total></order></reservation_response>';
elseif ($catalogId='catalog2')
return '<?xml version="1.0"?>
<reservation_response><order><code>GDLA4E-37</code><date>2009-12-06</date><package>100% TEQUILA Y AVENTURA&gt; EL AGUACATILLO</package><total>3366</total></order></reservation_response>';
} 
ini_set("soap.wsdl_cache_enabled", "0"); 
$server = new SoapServer("catalog.wsdl"); 
$server->addFunction("getCatalogEntry"); 
$server->handle();
?>
Y el del cliente "soap-client.php"
Código:
<?php  
  $client = new SoapClient("http://10.132.44.205/catalog.wsdl");
  $catalogId='catalog2';
  $response = $client->getCatalogEntry($catalogId);
  echo $response;
?>
Si ubico los 3 archivos en el mismo servidor y directorio todo funciona bien, pero si el cliente lo ubico en otro servidor, aparece un mensaje de error:
Código:
Fatal error:  Uncaught SoapFault exception: [Client] DTD are 
not supported by SOAP in C:\xampp\htdocs\soap-client.php:5 
Stack trace: #0 [internal function]: SoapClient->__call('getCatalogEntry', 
Array) #1 C:\xampp\htdocs\soap-client.php(5): 
SoapClient->getCatalogEntry('catalog2') #2 {main}   thrown in 
C:\xampp\htdocs\soap-client.php on line 5
 
Este mismo problema lo subí a un foro en meetup.com (The Los Angeles PHP Developers Meetup Group) y la respuesta final parece ser "El servidor, de alguna manera, no quiere servir el WSDL"
Es por eso que estoy tratando de aislar el problema, esperando que si se resuelve esto, todo lo demás funcione (o de plano se descarte)
__________________
Agradezco de antemano su valiosísima ayuda.
Marco Ríos
Ciudad de México

Última edición por solinem; 29/12/2009 a las 18:55