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
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
Comment