vbnet Call Web Service

Dim ss As New ServiceReference.OrderSoapClient()
Dim sb() As ServiceReference.Order

sb = ss.GetOrders()
If Not sb Is Nothing Then
	Dim SavePath As String = My.Settings.SavePath
	Dim OrderFile As String = "123.xml"
	Dim xmlserial As New Xml.Serialization.XmlSerializer(sb.GetType)

	SavePath = SavePath & IIf(Right(SavePath, 1) = "\", "", "\")
	Dim fileStream As New System.IO.StreamWriter(SavePath & OrderFile)
	xmlserial.Serialize(fileStream, sb)

End If
Writes the XML from a Web Service call to file.

Updated: Sunday 10th October 2010, 05:45am

There are 0 comments

Leave a comment of your own

Comments are currently closed.