How do I output webservice as XML stream? File?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark B

    How do I output webservice as XML stream? File?

    This code is returning a HTPP Internal Server Error.

    How do I amend it to:

    a) Create an XML file on the server
    b) Return a XML stream to the person who called the webservice?


    <System.Web.Ser vices.WebMethod ()_
    Public Function WsTableValuesGe t( _
    ByVal strPlatform As String _
    ) As String

    Dim sqlConnection1 As New SqlConnection(G etConnectionStr ing())
    Dim cmd As New SqlCommand

    Dim ds As New DataSet
    cmd.Connection = sqlConnection1
    cmd.CommandText = "uspServicesTab leValuesGet"
    cmd.CommandType = CommandType.Sto redProcedure
    cmd.Parameters. AddWithValue("@ EnterPlatform", strPlatform)

    Try
    sqlConnection1. Open()
    ds.DataSetName = "XMLData"
    ds.Load(cmd.Exe cuteReader(), LoadOption.Over writeChanges,
    "XMLData")
    ds.WriteXml("My NewXMLFile.xml" , XmlWriteMode.Ig noreSchema)

    Catch ex As SqlException
    Throw ex
    Finally
    sqlConnection1. Close()
    sqlConnection1. Dispose()
    cmd.Dispose()
    End Try

    End Function

  • John Saunders

    #2
    Re: How do I output webservice as XML stream? File?

    "Mark B" <none123@none.c omwrote in message
    news:uA6xuExOJH A.4264@TK2MSFTN GP05.phx.gbl...
    This code is returning a HTPP Internal Server Error.
    >
    How do I amend it to:
    >
    a) Create an XML file on the server
    b) Return a XML stream to the person who called the webservice?
    Why is it returning an HTTP Internal Server Error? Why do you believe the
    error has anything to do with how you return the data?

    --
    John Saunders | MVP - Connected System Developer

    Comment

    Working...