Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/05/2012, 04:30
Avatar de Scour
Scour
 
Fecha de Ingreso: octubre-2003
Ubicación: Murcia (España)
Mensajes: 94
Antigüedad: 20 años, 6 meses
Puntos: 0
Editar WSDL en Web Service

Buenos días,

Tengo el siguiente problema. Tengo que programar un Web Service para que un cliente lo consuma a modo de interface entre sus sistemas y los nuestros, y por X motivos, el cliente me solicita que el Servicio no devuelva nada (no tenga parámetros de salida).

El Servicio es:
Código ASP:
Ver original
  1. Imports System.Web.Services
  2. Imports System.Web.Services.Protocols
  3. Imports System.ComponentModel
  4. Imports System.IO
  5. Imports System.Xml
  6.  
  7. ' Para permitir que se llame a este servicio web desde un script, usando ASP.NET AJAX, quite la marca de comentario de la siguiente línea.
  8. ' <System.Web.Script.Services.ScriptService()> _
  9. <System.Web.Services.WebService(Namespace:="https://servicios2/ws/")> _
  10. <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
  11. <ToolboxItem(False)> _
  12. Public Class Service1
  13.     Inherits System.Web.Services.WebService
  14.  
  15.     <WebMethod()> _
  16.     Public Sub MaterialMaster(ByVal XmlDoc As XmlDocument)
  17.         'Código...
  18.     End Sub
  19.  
  20. End Class

Como veis, es un procedimiento y como tal no tiene parámetros de salida.

El WSDL que genera de forma dinámica .Net es el que sigue:

Código XML:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://servicios2/ws/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="https://servicios2/ws/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  4.  
  5.   <wsdl:types>
  6.  
  7.     <s:schema elementFormDefault="qualified" targetNamespace="https://servicios2/ws/">
  8.  
  9.       <s:element name="MaterialMaster">
  10.  
  11.         <s:complexType>
  12.  
  13.           <s:sequence>
  14.  
  15.             <s:element minOccurs="0" maxOccurs="1" name="XmlDoc">
  16.  
  17.               <s:complexType mixed="true">
  18.  
  19.                 <s:sequence>
  20.  
  21.                   <s:any />
  22.  
  23.                 </s:sequence>
  24.  
  25.               </s:complexType>
  26.  
  27.             </s:element>
  28.  
  29.           </s:sequence>
  30.  
  31.         </s:complexType>
  32.  
  33.       </s:element>
  34.  
  35.       <s:element name="MaterialMasterResponse">
  36.  
  37.         <s:complexType />
  38.  
  39.       </s:element>
  40.  
  41.     </s:schema>
  42.  
  43.   </wsdl:types>
  44.  
  45.   <wsdl:message name="MaterialMasterSoapIn">
  46.  
  47.     <wsdl:part name="parameters" element="tns:MaterialMaster" />
  48.  
  49.   </wsdl:message>
  50.  
  51.   <wsdl:message name="MaterialMasterSoapOut">
  52.  
  53.     <wsdl:part name="parameters" element="tns:MaterialMasterResponse" />
  54.  
  55.   </wsdl:message>
  56.  
  57.   <wsdl:portType name="Service1Soap">
  58.  
  59.     <wsdl:operation name="MaterialMaster">
  60.  
  61.       <wsdl:input message="tns:MaterialMasterSoapIn" />
  62.  
  63.       <wsdl:output message="tns:MaterialMasterSoapOut" />
  64.  
  65.     </wsdl:operation>
  66.  
  67.   </wsdl:portType>
  68.  
  69.   <wsdl:binding name="Service1Soap" type="tns:Service1Soap">
  70.  
  71.     <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
  72.  
  73.     <wsdl:operation name="MaterialMaster">
  74.  
  75.       <soap:operation soapAction="https://servicios2/ws/MaterialMaster" style="document" />
  76.  
  77.       <wsdl:input>
  78.  
  79.         <soap:body use="literal" />
  80.  
  81.       </wsdl:input>
  82.  
  83.      [B] <wsdl:output>
  84.  
  85.         <soap:body use="literal" />
  86.  
  87.       </wsdl:output>[/B]
  88.  
  89.     </wsdl:operation>
  90.  
  91.   </wsdl:binding>
  92.  
  93.   <wsdl:binding name="Service1Soap12" type="tns:Service1Soap">
  94.  
  95.     <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
  96.  
  97.     <wsdl:operation name="MaterialMaster">
  98.  
  99.       <soap12:operation soapAction="https://servicios2/ws/MaterialMaster" style="document" />
  100.  
  101.       <wsdl:input>
  102.  
  103.         <soap12:body use="literal" />
  104.  
  105.       </wsdl:input>
  106.  
  107.      [B] <wsdl:output>
  108.  
  109.         <soap12:body use="literal" />
  110.  
  111.       </wsdl:output>[/B]
  112.  
  113.     </wsdl:operation>
  114.  
  115.   </wsdl:binding>
  116.  
  117.   <wsdl:service name="Service1">
  118.  
  119.     <wsdl:port name="Service1Soap" binding="tns:Service1Soap">
  120.  
  121.       <soap:address location="https://servicios2/ws/Service1.asmx" />
  122.  
  123.     </wsdl:port>
  124.  
  125.     <wsdl:port name="Service1Soap12" binding="tns:Service1Soap12">
  126.  
  127.       <soap12:address location="https://servicios2/ws/Service1.asmx" />
  128.  
  129.     </wsdl:port>
  130.  
  131.   </wsdl:service>
  132.  
  133. </wsdl:definitions>

Genera etiquetas Output, y el cliente me solicita que para que funcione correctamente en su soft, tengo que quitar esos parámetros de salida (etiquetas Output) del WSDL...

¿Por qué genera esas etiquetas si no hay ningún parámetro de salida? y sobre todo, ¿Cómo puedo editar el WSDL que se genera de forma dinámica para que no las genere?

Muchas gracias de antemano.

Saludos.