webservice xsd / xml validator?
- From: "billb" <billb@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 20 Oct 2005 19:32:01 -0700
Hi all...
I have a web method that doesvaildation but does not return just the xml
from the invoke method, it retruns both the schema and the xml in the difgram
.. The webmethod I'm using looks like this and wondered if anyone knows just
how to display the xml from the invoke call. Any help would be greatly
appreciated. Thanks.
Imports System
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Xml
Imports System.Xml.Schema
Imports System.Xml.XPath
Imports System.IO
Imports System.Data.DataSet
'TO DO: move namespace to standard
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class HostTest
Inherits System.Web.Services.WebService
#Region "webservice consts"
Private reader As XmlReader
Private navigator As XPathNavigator
Private settings As XmlReaderSettings
Private document As XmlDocument
Private xmlDoc As XPathDocument
Private strLine As String
Private objStreamReader As StreamReader
Private components As System.ComponentModel.IContainer
Private doc As XmlDocument = New XmlDocument()
Dim DS As Data.DataSet
Dim DT As DataTable
#End Region
#Region "WebMethod - XML to string"
<WebMethod()> _
Public Function GetRequest(ByVal fldRequest As String, ByVal fldRqstTyp
As String) As Data.DataSet
''convert data to xml
doc.Load("C:\website\My.XML")
Dim ds As DataSet = New DataSet()
Dim buf As Byte() =
System.Text.ASCIIEncoding.ASCII.GetBytes(doc.OuterXml)
Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream(buf)
ds.ReadXml(ms, XmlReadMode.InferSchema)
ms.Close()
ds.WriteXmlSchema("C:\website\MY_XML.xsd")
Return ds
End Function
#End Region
End Class
.
- Prev by Date: Re: Transform Xml to DataSet
- Next by Date: RE: am I misunderstanding readxmlschema ?
- Previous by thread: Re: streaming random filetypes from .aspx
- Next by thread: Duplicate Element Names in Serialized XML
- Index(es):
Relevant Pages
|