Ask this question on a .NET discussion list.
On 7/21/05, Manuel Nicolas Ortuño <[EMAIL PROTECTED]> wrote: > Thanks Anne. > How can I use the .NET low level interface to process <xsd:anyType> messages > (I can't use the .NET [WebReference] capability)? > > Any example or any url? > > Thanks in advance. > > -----Mensaje original----- > De: Anne Thomas Manes [mailto:[EMAIL PROTECTED] > Enviado el: miércoles, 20 de julio de 2005 15:05 > Para: [email protected]; [EMAIL PROTECTED] > Asunto: Re: Service Java and Client .NET with type document > > You must use the .NET low level interface to process <xsd:anyType> > messages. (You can't use the .NET [WebReference] capability.) > > Anne > > On 7/20/05, Manuel Nicolas Ortuño <[EMAIL PROTECTED]> wrote: > > > > > > > > Hello > > > > I have a webservice created with Axis 1.2 and Java. I trying to consuming > in > > .NET with Windows Visual C# .NET. The method of webservice is "Document > > method (Document doc)", wsdd style="message". I added a webreference to > > webservice in .NET. When I call the service, it's don't return nothing. > The > > object is undefined value. I verified the webservice whith a client of > Java > > and XMLSpy too, the response was OK.Is there any problem with object type > > Document and .NET? > > > > Any help? > > > > Thanks in advance. > > > > > > > > > > > > WSDL of webservice > > > > > > > > <?xml version="1.0" encoding="UTF-8"?> > > > > <wsdl:definitions > > targetNamespace="http://cierva2.carm.es/axis/services/Eventos" > > xmlns:apachesoap="http://xml.apache.org/xml-soap" > > xmlns:impl="http://cierva2.carm.es/axis/services/Eventos" > > xmlns:intf="http://cierva2.carm.es/axis/services/Eventos" > > xmlns:tns1="http://eventos" > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > > xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > > > <!--WSDL created by Apache Axis version: 1.2 > > > > Built on May 03, 2005 (02:20:24 EDT)--> > > > > <wsdl:types> > > > > <schema targetNamespace="http://eventos" > > xmlns="http://www.w3.org/2001/XMLSchema"> > > > > <element name="EventosFechas" type="xsd:anyType"/> > > > > <element name="EventosActividadFechas" type="xsd:anyType"/> > > > > <element name="EventosTemaFechas" type="xsd:anyType"/> > > > > </schema> > > > > <schema > > targetNamespace="http://cierva2.carm.es/axis/services/Eventos" > > xmlns="http://www.w3.org/2001/XMLSchema"> > > > > <element name="EventosFechasReturn" type="xsd:anyType"/> > > > > <element name="EventosActividadFechasReturn" > > type="xsd:anyType"/> > > > > <element name="EventosTemaFechasReturn" type="xsd:anyType"/> > > > > </schema> > > > > </wsdl:types> > > > > > > > > <wsdl:message name="EventosFechasResponse"> > > > > > > > > <wsdl:part element="impl:EventosFechasReturn" > > name="EventosFechasReturn"/> > > > > > > > > </wsdl:message> > > > > > > > > <wsdl:message name="EventosTemaFechasRequest"> > > > > > > > > <wsdl:part element="tns1:EventosTemaFechas" > > name="part"/> > > > > > > > > </wsdl:message> > > > > > > > > <wsdl:message name="EventosActividadFechasResponse"> > > > > > > > > <wsdl:part > > element="impl:EventosActividadFechasReturn" > > name="EventosActividadFechasReturn"/> > > > > > > > > </wsdl:message> > > > > > > > > <wsdl:message name="EventosTemaFechasResponse"> > > > > > > > > <wsdl:part element="impl:EventosTemaFechasReturn" > > name="EventosTemaFechasReturn"/> > > > > > > > > </wsdl:message> > > > > > > > > <wsdl:message name="EventosActividadFechasRequest"> > > > > > > > > <wsdl:part element="tns1:EventosActividadFechas" > > name="part"/> > > > > > > > > </wsdl:message> > > > > > > > > <wsdl:message name="EventosFechasRequest"> > > > > > > > > <wsdl:part element="tns1:EventosFechas" name="part"/> > > > > > > > > </wsdl:message> > > > > > > > > <wsdl:portType name="Evento"> > > > > > > > > <wsdl:operation name="EventosFechas"> > > > > > > > > <wsdl:input message="impl:EventosFechasRequest" > > name="EventosFechasRequest"/> > > > > > > > > <wsdl:output message="impl:EventosFechasResponse" > > name="EventosFechasResponse"/> > > > > > > > > </wsdl:operation> > > > > > > > > <wsdl:operation name="EventosActividadFechas"> > > > > > > > > <wsdl:input > > message="impl:EventosActividadFechasRequest" > > name="EventosActividadFechasRequest"/> > > > > > > > > <wsdl:output > > message="impl:EventosActividadFechasResponse" > > name="EventosActividadFechasResponse"/> > > > > > > > > </wsdl:operation> > > > > > > > > <wsdl:operation name="EventosTemaFechas"> > > > > > > > > <wsdl:input > > message="impl:EventosTemaFechasRequest" > > name="EventosTemaFechasRequest"/> > > > > > > > > <wsdl:output > > message="impl:EventosTemaFechasResponse" > > name="EventosTemaFechasResponse"/> > > > > > > > > </wsdl:operation> > > > > > > > > </wsdl:portType> > > > > > > > > <wsdl:binding name="EventosSoapBinding" type="impl:Evento"> > > > > > > > > <wsdlsoap:binding style="document" > > transport="http://schemas.xmlsoap.org/soap/http"/> > > > > > > > > <wsdl:operation name="EventosFechas"> > > > > > > > > <wsdlsoap:operation soapAction=""/> > > > > > > > > <wsdl:input name="EventosFechasRequest"> > > > > > > > > <wsdlsoap:body use="literal"/> > > > > > > > > </wsdl:input> > > > > > > > > <wsdl:output name="EventosFechasResponse"> > > > > > > > > <wsdlsoap:body use="literal"/> > > > > > > > > </wsdl:output> > > > > > > > > </wsdl:operation> > > > > > > > > <wsdl:operation name="EventosActividadFechas"> > > > > > > > > <wsdlsoap:operation soapAction=""/> > > > > > > > > <wsdl:input name="EventosActividadFechasRequest"> > > > > > > > > <wsdlsoap:body use="literal"/> > > > > > > > > </wsdl:input> > > > > > > > > <wsdl:output > > name="EventosActividadFechasResponse"> > > > > > > > > <wsdlsoap:body use="literal"/> > > > > > > > > </wsdl:output> > > > > > > > > </wsdl:operation> > > > > > > > > <wsdl:operation name="EventosTemaFechas"> > > > > > > > > <wsdlsoap:operation soapAction=""/> > > > > > > > > <wsdl:input name="EventosTemaFechasRequest"> > > > > > > > > <wsdlsoap:body use="literal"/> > > > > > > > > </wsdl:input> > > > > > > > > <wsdl:output name="EventosTemaFechasResponse"> > > > > > > > > <wsdlsoap:body use="literal"/> > > > > > > > > </wsdl:output> > > > > > > > > </wsdl:operation> > > > > > > > > </wsdl:binding> > > > > > > > > <wsdl:service name="EventoService"> > > > > > > > > <wsdl:port binding="impl:EventosSoapBinding" > > name="Eventos"> > > > > > > > > <wsdlsoap:address > > location="http://cierva2.carm.es/axis/services/Eventos"/> > > > > > > > > </wsdl:port> > > > > > > > > </wsdl:service> > > > > > > > > </wsdl:definitions> > > > > > > > > > > > > client C#.NET > > > > > > > > using System; > > > > using System.Drawing; > > > > using System.Collections; > > > > using System.ComponentModel; > > > > using System.Windows.Forms; > > > > using System.Data; > > > > using System.Xml; > > > > > > > > namespace ClienteMurcia > > > > { > > > > /// <summary> > > > > /// Descripción breve de Form1. > > > > /// </summary> > > > > public class Form1 : System.Windows.Forms.Form > > > > { > > > > /// <summary> > > > > /// Variable del diseñador requerida. > > > > /// </summary> > > > > private System.ComponentModel.Container components > = > > null; > > > > private System.Windows.Forms.TextBox textBox1; > > > > private Eventos.EventoService eventos = new > > ClienteMurcia.Eventos.EventoService(); > > > > > > > > public Form1() > > > > { > > > > // > > > > // Necesario para > > admitir el Diseñador de Windows Forms > > > > // > > > > InitializeComponent(); > > > > > > > > // > > > > // TODO: agregar código > > de constructor después de llamar a InitializeComponent > > > > // > > > > } > > > > > > > > /// <summary> > > > > /// Limpiar los recursos que se estén utilizando. > > > > /// </summary> > > > > protected override void Dispose( bool disposing ) > > > > { > > > > if( disposing ) > > > > { > > > > if > > (components != null) > > > > { > > > > > > components.Dispose(); > > > > } > > > > } > > > > base.Dispose( disposing > > ); > > > > } > > > > > > > > #region Código generado por el Diseñador de > Windows > > Forms > > > > /// <summary> > > > > /// Método necesario para admitir el Diseñador. No > > se puede modificar > > > > /// el contenido del método con el editor de > código. > > > > /// </summary> > > > > private void InitializeComponent() > > > > { > > > > this.textBox1 = new > > System.Windows.Forms.TextBox(); > > > > this.SuspendLayout(); > > > > // > > > > // textBox1 > > > > // > > > > this.textBox1.AutoSize = > > false; > > > > this.textBox1.Location = > > new System.Drawing.Point(8, 16); > > > > this.textBox1.Name = > > "textBox1"; > > > > this.textBox1.Size = new > > System.Drawing.Size(272, 248); > > > > this.textBox1.TabIndex = > > 0; > > > > this.textBox1.Text = ""; > > > > // > > > > // Form1 > > > > // > > > > this.AutoScaleBaseSize = > > new System.Drawing.Size(5, 13); > > > > this.ClientSize = new > > System.Drawing.Size(292, 273); > > > > > > this.Controls.Add(this.textBox1); > > > > this.Name = "Form1"; > > > > this.Text = "Form1"; > > > > this.Load += new > > System.EventHandler(this.Form1_Load); > > > > > > this.ResumeLayout(false); > > > > > > > > } > > > > #endregion > > > > > > > > /// <summary> > > > > /// Punto de entrada principal de la aplicación. > > > > /// </summary> > > > > [STAThread] > > > > static void Main() > > > > { > > > > Application.Run(new > > Form1()); > > > > } > > > > > > > > private void Form1_Load(object sender, > > System.EventArgs e) > > > > { > > > > XmlDocument docEntrada = > > GetXMLRequest("15/07/05","25/07/05"); > > > > System.Xml.XmlDocument > > docSalida = eventos.EventosFechas(docEntrada); > > > > > > //docSalida.Save("C:/prueba.txt"); > > > > > > > > > > } > > > > > > > > private XmlDocument CreateNewXMLDocument(string > > ROOT_NODE) > > > > { > > > > //* Crea un XmlDocument > > Nuevo *// > > > > XmlDocument XMLDoc = new > > XmlDocument(); > > > > > > > > > > > > //* Crea el Nodo > > XmlDeclaration *// > > > > /*XmlDeclaration > > xmldecl; > > > > xmldecl = > > XMLDoc.CreateXmlDeclaration("1.0", "utf-8", null); > > > > > > XMLDoc.AppendChild(xmldecl);*/ > > > > > > > > //* Crea el Nodo Raiz > > *// > > > > XmlElement XMLElemento = > > XMLDoc.CreateElement(ROOT_NODE); > > > > > > XMLDoc.AppendChild(XMLElemento); > > > > > > > > > > > > //* Retorna el Documento > > Creado *// > > > > return XMLDoc; > > > > } > > > > > > > > private XmlDocument GetXMLRequest(string dateFrom, > > string dateUntil) > > > > { > > > > XmlElement XMLElem; > > > > XmlDocument XMLPet; > > > > > > > > > > > > //* Crea el XmlDocument > > y el Nodo Fechas *// > > > > XMLPet = > > CreateNewXMLDocument("consulta"); > > > > XmlNode XMLRoot = > > XMLPet.SelectSingleNode("consulta"); > > > > XMLElem = > > XMLPet.CreateElement("fechas"); > > > > > > XMLRoot.AppendChild(XMLElem); > > > > > > > > //* Inserta la Fecha > > Inicial del Evento *// > > > > XMLElem = > > XMLPet.CreateElement("fechaDesde"); > > > > XMLElem.InnerText = > > dateFrom; > > > > > > XMLRoot.SelectSingleNode("fechas").AppendChild(XMLElem); > > > > > > > > //* Inserta la Fecha > > Final del Evento *// > > > > XMLElem = > > XMLPet.CreateElement("fechaHasta"); > > > > XMLElem.InnerText = > > dateUntil; > > > > > > XMLRoot.SelectSingleNode("fechas").AppendChild(XMLElem); > > > > > > > > > > > > //* Retorna el Documento > > XML *// > > > > return XMLPet; > > > > } > > > > } > > > > } > >
