By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,886 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,886 IT Pros & Developers. It's quick & easy.

How do I output webservice as XML stream? File?

P: n/a
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.Services.WebMethod()_
Public Function WsTableValuesGet( _
ByVal strPlatform As String _
) As String

Dim sqlConnection1 As New SqlConnection(GetConnectionString())
Dim cmd As New SqlCommand

Dim ds As New DataSet
cmd.Connection = sqlConnection1
cmd.CommandText = "uspServicesTableValuesGet"
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@EnterPlatform", strPlatform)

Try
sqlConnection1.Open()
ds.DataSetName = "XMLData"
ds.Load(cmd.ExecuteReader(), LoadOption.OverwriteChanges,
"XMLData")
ds.WriteXml("MyNewXMLFile.xml", XmlWriteMode.IgnoreSchema)

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

End Function

Oct 31 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Mark B" <no*****@none.comwrote in message
news:uA**************@TK2MSFTNGP05.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

Nov 2 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.