Skip to Content
author's profile photo Former Member
Former Member

Need to xpose odata service to client

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Apr 21, 2016 at 11:44 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.