Try OpenEdge Now
skip to main content
Web Services
Developing a .NET Client to Consume OpenEdge SOAP Web Services : Developing the VB.NET client application : Preparing schema and data for input TABLE-HANDLE parameter
 

Preparing schema and data for input TABLE-HANDLE parameter

This example shows how you might prepare the schema and data for an input TABLE-HANDLE parameter by building up the XML element nodes for the SOAP message from existing XML Schema and XML data files:
Dim schemaDoc As XmlDocument = New XmlDocument( )
Dim dataDoc As XmlDocument = New XmlDocument( )
Dim dataSetDoc As XmlDocument = New XmlDocument( )
Dim root As XmlElement
Dim schemaNode As XmlNode
Dim dataNode As XmlNode

' Load XML Schema(.xsd) and Data(.xml) files into XmlDocuments
schemaDoc.Load("ttEmp.xsd")
dataDoc.Load("empData.xml")

' Load the outer element into the dataSetDoc XmlDocument
dataSetDoc.LoadXml("<DataSet></DataSet>")
root = dataSetDoc.DocumentElement
root.SetAttribute("xmlns", "")

' Insert schema and data nodes as children of the dataSetDoc root node
schemaNode = dataSetDoc.ImportNode(schemaDoc.DocumentElement, True)
dataNode = dataSetDoc.ImportNode(dataDoc.DocumentElement, True)

root.AppendChild(schemaNode)
root.AppendChild(dataNode)

dynTTEl = dataSetDoc.DocumentElement( )