on 04-20-2016 8:56 PM
hi all,
iam new to hana platform, i have webservice which is xposed to client, please see the code below i want replicate that in hana, is that possible.
Sub CreateXML()
Dim spTA As New sp_GETXML_WSTableAdapter
Dim spTB As dsTradenet.sp_GETXML_WSDataTable = spTA.GetData("TW-2461")
Dim spPTA As New sp_GETXML_WS_PRODTableAdapter
Dim spPTB As dsTradenet.sp_GETXML_WS_PRODDataTable
Dim dr As DataRow
Dim dp As DataRow
Dim doc As XmlDocument = New XmlDocument()
Dim docNode As XmlNode = doc.CreateXmlDeclaration("1.0", "UTF-8", Nothing)
doc.AppendChild(docNode)
Dim enqNode As XmlNode = doc.CreateElement("ENQUIRIES")
doc.AppendChild(enqNode)
Dim allNode As XmlNode = doc.CreateElement("ALL")
enqNode.AppendChild(allNode)
For Each dr In spTB.Rows
Dim recNode As XmlNode = doc.CreateElement("REPREC")
allNode.AppendChild(recNode)
For x As Integer = 0 To dr.Table.Columns.Count - 1
Dim r As XmlNode = doc.CreateElement(dr.Table.Columns(x).ColumnName)
r.AppendChild(doc.CreateTextNode(cnn(dr.Item(x))))
recNode.AppendChild(r)
Next
spPTB = spPTA.GetData(dr.Item("DOCREF"))
For Each dp In spPTB.Rows
Dim prodNode As XmlNode = doc.CreateElement("PRODUCTS")
For y As Integer = 0 To dp.Table.Columns.Count - 1
Dim p As XmlNode = doc.CreateElement(dp.Table.Columns(y).ColumnName)
p.AppendChild(doc.CreateTextNode(dp.Item(y)))
prodNode.AppendChild(p)
Next
recNode.AppendChild(prodNode)
Next
Next
doc.Save("c:\temp\doc.xml")
End Sub
Is your question how you expose an OData service on HANA or how you create an XML? Your coding just creates an XML.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Don't really understand that. Why you wanna build an XML and expose it via an OData service. As far as I can see from the coding, there is just a table affected which data is written to an XML. So why not just defining an OData service for the entity. You would be able to consume it as AtomXML or as JSON. Details: Data Access with OData in SAP HANA XS - SAP HANA Developer Guide for SAP HANA Studio - SAP Library
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.