23Sample ASPs for Household Financial Accounts Virtual Business Components

Sample ASPs for Household Financial Accounts Virtual Business Components

About Sample ASPs for Household Financial Accounts Virtual Business Components

This appendix lists the sample ASPs for household financial accounts virtual business components.Siebel Finance includes virtual business components to display financial account data sourced from a back office or a third-party system. Use these virtual business components for specific financial accounts views within the Households screen. For more information, see Setting Up Household Financial Accounts Virtual Business Components.

You can use these sample Active Server Pages (ASPs) to retrieve data from a test database, and return an XML file in Siebel format to Oracle’s Siebel XML Gateway business service. For more information on setting up a test ASP, see Setting Up a Test ASP and Testing the Local Database.

cashflow.asp

Use the following sample ASP to test retrieving data for the Cash Flow view.

<%@ EnableSessionState=False Language=VBScript %>

<% option explicit %>

<%

Dim Conn

Dim SQL

Dim R

Dim F

Dim RecsAffected

Dim aConnectionString

aConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _

	& "Data Source=c:\Inetpub\ibd\mdb.mdb"


Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Mode = 3

Conn.ConnectionString = aConnectionString

Conn.CursorLocation = 3

Conn.Open

SQL="SELECT * from cashflow"

Set R=Server.CreateObject("ADODB.Recordset")



dim v

dim fs

dim ts

dim sReq

Dim aPath 

Dim aLogFile

dim item


aPath = Request.ServerVariables("PATH_TRANSLATED") 

'Response.Write aPath



' strip the file name from the path 

aPath = Left(aPath, instrRev(aPath, "\")) 

' add the log file name

aLogFile = aPath & "\log\cash.log"


set fs = Server.CreateObject("Scripting.FileSystemObject")

set ts = fs.OpenTextFile(aLogFile, 8, True, 0)



'for each item in Request.ServerVariables

	'ts.write item*********

	'ts.writeline Request.ServerVariables(item)

'next



dim domDoc

dim aFilename

set domDoc = Server.CreateObject("MSXML.DOMDocument")

domDoc.async = false

'domDoc.setProperty("ServerHTTPRequest")=true

domDoc.load(Request)




dim node

dim nodes

dim mainNode

dim mainNodes

dim matchNode

dim matchNodes

dim attribs

dim attrib

dim SQLwhere

Dim root

dim SQLinsert

dim SQLfields

dim SQLvalues

dim sWhere

dim x

dim y

dim sFields

dim sValues



set root = domDoc.documentElement



dim nName

dim inputText

dim data



'inputText = Request.Form("textInput")



nName = root.nodeName



Select Case nName



Case "siebel-xmlext-fields-req"



R.Open SQL, Conn, 3, 1, &H0001

domDoc.save (server.MapPath("init1.xml"))

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-fields-ret>"

For Each F in R.Fields

  Response.Write "<support field='"& F.Name &"'/>"

Next

Response.Write "</siebel-xmlext-fields-ret>"

R.Close



Case "siebel-xmlext-query-req"



'This section of SelectCase is for the Query Request

dim attVal1(25)

dim attName1(25)



set mainNodes = root.childNodes

ts.writeline "Document have MainNodes: " & mainNodes.length

Dim z

z = 0

For each matchNode in MainNodes

  'attVal1(z) = matchNode.text

  'set attribs = matchNode.attributes

  'set attrib = attribs(0)

  'attName1(z) = attrib.nodeValue

'ts.writeline

ts.writeline "MainNode " & z

'ts.write z

ts.writeline "Main Node Name: " & matchNode.nodeName

ts.writeline "Main Node type: " & matchNode.nodeType

ts.writeline "Main Node value: " & matchNode.nodeValue

'ts.writeline "match Node data: " & matchNode.data

ts.writeline "Main line text: " & matchNode.text

'ts.write attrib.nodeValue



z = z +1

next

set matchNodes = root.SelectNodes("search-string")

ts.writeline "MatchNodes in document are : " & matchNodes.length

x = 0



For each matchNode in matchNodes


ts.writeline "Match string is :" & matchNode.text

sWhere = matchNode.text

x = x +1

next



ts.writeline "This is sWhere " & sWhere



'setting the WHERE clause in order to query the correct recordset



if  sWhere="" then

SQLwhere = SQL

else

SQLwhere = " WHERE " & sWhere

SQLwhere = SQL + SQLwhere

end if

'Response.Write SQLwhere

R.Open SQLwhere, Conn, 3, 1, &H0001



'for debugging

domDoc.save (server.MapPath("init2.xml"))

'build response stream by iterating through the recordset

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-query-ret>"

'ts.write "<?xml version="1.0" encoding="UTF-8"?>"

'ts.write "<siebel-xmlext-query-ret>"



While Not R.EOF

  Response.Write "<row>"

  'ts.write "<row>"

For Each F in R.Fields

  Response.Write "<value field="""& F.Name &""">"& F.Value &"</value>"

  'ts.write "<value field="""& F.Name &""">"& F.Value &"</value>"

Next

Response.Write "</row>"

'ts.write "</row>"

R.MoveNext

Wend

Response.Write "</siebel-xmlext-query-ret>"

'ts.write "</siebel-xmlext-query-ret>"

R.Close



Case "siebel-xmlext-preinsert-req"



'Section for PreInsert

Response.Write "<siebel-xmlext-preinsert-ret>"

Response.Write "<row></row>"

Response.Write "</siebel-xmlext-preinsert-ret>"


Case "siebel-xmlext-insert-req"

'Section for Insert



Case "siebel-xmlext-delete-req"

'Section for Delete



End Select



'cleaning up the objects in memory

ts.close

set root = Nothing

set domDoc = Nothing

set ts = Nothing

set fs = Nothing

Set R = Nothing

Conn.Close

Set Conn = Nothing

%>

Performance.asp

Use the following sample ASP to test retrieving data for the Performance view.

<%@ EnableSessionState=False Language=VBScript %>

<% option explicit %>

<%

Dim Conn

Dim SQL

Dim R

Dim F

Dim RecsAffected

Dim aConnectionString


aConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _

  & "Data Source=c:\Inetpub\ibd\mdb.mdb"


Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Mode = 3

Conn.ConnectionString = aConnectionString

Conn.CursorLocation = 3

Conn.Open

SQL="SELECT * from perf"

Set R=Server.CreateObject("ADODB.Recordset")




dim v

dim fs

dim ts

dim sReq

Dim aPath 

Dim aLogFile

dim item



aPath = Request.ServerVariables("PATH_TRANSLATED") 

'Response.Write aPath



' strip the file name from the path 

aPath = Left(aPath, instrRev(aPath, "\")) 

' add the log file name

aLogFile = aPath & "\log\perf.log"

set fs = Server.CreateObject("Scripting.FileSystemObject")

set ts = fs.OpenTextFile(aLogFile, 8, True, 0)



'for each item in Request.ServerVariables

  'ts.write item

  'ts.writeline Request.ServerVariables(item)

'next



dim domDoc

dim aFilename

set domDoc = Server.CreateObject("MSXML.DOMDocument")

domDoc.async = false

'domDoc.setProperty("ServerHTTPRequest")=true

domDoc.load(Request)



dim node

dim nodes

dim mainNode

dim mainNodes

dim matchNode

dim matchNodes

dim attribs

dim attrib

dim SQLwhere

Dim root

dim SQLinsert

dim SQLfields

dim SQLvalues

dim sWhere

dim x

dim y

dim sFields

dim sValues



set root = domDoc.documentElement



dim nName

dim inputText

dim data



'inputText = Request.Form("textInput")



nName = root.nodeName



Select Case nName



Case "siebel-xmlext-fields-req"



R.Open SQL, Conn, 3, 1, &H0001

domDoc.save (server.MapPath("init1.xml"))

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-fields-ret>"

For Each F in R.Fields

  Response.Write "<support field='"& F.Name &"'/>"

Next

Response.Write "</siebel-xmlext-fields-ret>"

R.Close



Case "siebel-xmlext-query-req"



'This section of SelectCase is for the Query Request

dim attVal1(25)

dim attName1(25)



set mainNodes = root.childNodes

ts.writeline "Document have MainNodes: " & mainNodes.length

Dim z

z = 0

For each matchNode in MainNodes

  'attVal1(z) = matchNode.text

  'set attribs = matchNode.attributes

  'set attrib = attribs(0)

  'attName1(z) = attrib.nodeValue

'ts.writeline

ts.writeline "MainNode " & z

'ts.write z

ts.writeline "Main Node Name: " & matchNode.nodeName

ts.writeline "Main Node type: " & matchNode.nodeType

ts.writeline "Main Node value: " & matchNode.nodeValue

'ts.writeline "match Node data: " & matchNode.data

ts.writeline "Main line text: " & matchNode.text

'ts.write attrib.nodeValue



z = z +1

next

set matchNodes = root.SelectNodes("search-string")

ts.writeline "MatchNodes in document are : " & matchNodes.length

x = 0

For each matchNode in matchNodes



ts.writeline "Match string is :" & matchNode.text

sWhere = matchNode.text

x = x +1

next



ts.writeline "This is sWhere " & sWhere



'setting the WHERE clause in order to query the correct recordset



if  sWhere="" then

SQLwhere = SQL

else

SQLwhere = " WHERE " & sWhere

SQLwhere = SQL + SQLwhere

end if

'Response.Write SQLwhere

R.Open SQLwhere, Conn, 3, 1, &H0001



'for debugging

domDoc.save (server.MapPath("init2.xml"))



'build response stream by iterating through the recordset

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-query-ret>"

'ts.write "<?xml version="1.0" encoding="UTF-8"?>"

'ts.write "<siebel-xmlext-query-ret>"



While Not R.EOF

  Response.Write "<row>"

  'ts.write "<row>"

For Each F in R.Fields

  Response.Write "<value field="""& F.Name &""">"& F.Value &"</value>"

  'ts.write "<value field="""& F.Name &""">"& F.Value &"</value>"

Next

Response.Write "</row>"

'ts.write "</row>"

R.MoveNext

Wend

Response.Write "</siebel-xmlext-query-ret>"

'ts.write "</siebel-xmlext-query-ret>"

R.Close



Case "siebel-xmlext-preinsert-req"


'Section for PreInsert

Response.Write "<siebel-xmlext-preinsert-ret>"

Response.Write "<row></row>"

Response.Write "</siebel-xmlext-preinsert-ret>"




Case "siebel-xmlext-insert-req"

'Section for Insert

Case "siebel-xmlext-delete-req"

'Section for Delete



End Select


'cleaning up the objects in memory

ts.close

set root = Nothing

set domDoc = Nothing

set ts = Nothing

set fs = Nothing

Set R = Nothing

Conn.Close

Set Conn = Nothing

%>

ModelValueByClass.asp

Use the following sample ASP to test retrieving data for the Class Allocation view.

<%@ EnableSessionState=False Language=VBScript %>

<% option explicit %>

<%

Dim Conn

Dim SQL

Dim R

Dim F

Dim RecsAffected

Dim aConnectionString


aConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _

  & "Data Source=C:\Inetpub\ibd\mdb.mdb"


Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Mode = 3

Conn.ConnectionString = aConnectionString

Conn.CursorLocation = 3

Conn.Open

SQL="SELECT * from ModelValueByClass"

Set R=Server.CreateObject("ADODB.Recordset")



dim v

dim fs

dim ts

dim sReq

Dim aPath 

Dim aLogFile

dim item



aPath = Request.ServerVariables("PATH_TRANSLATED") 

'Response.Write aPath



' strip the file name from the path 

aPath = Left(aPath, instrRev(aPath, "\")) 

' add the log file name

aLogFile = aPath & "\log\ModelValueByClass.txt"



set fs = Server.CreateObject("Scripting.FileSystemObject")

set ts = fs.OpenTextFile(aLogFile, 8, True, 0)

for each item in Request.ServerVariables

  ts.write item

  ts.write Request.ServerVariables(item)

next



dim domDoc

dim aFilename

set domDoc = Server.CreateObject("MSXML.DOMDocument")

domDoc.async = false

'domDoc.setProperty("ServerHTTPRequest")=true

domDoc.load(Request)



dim node

dim nodes

dim mainNode

dim mainNodes

dim matchNode

dim matchNodes

dim attribs

dim attrib

dim SQLwhere

Dim root

dim SQLinsert

dim SQLfields

dim SQLvalues

dim sWhere

dim x

dim y

dim sFields

dim sValues

set root = domDoc.documentElement



dim nName

dim inputText

dim data



'inputText = Request.Form("textInput")

nName = root.nodeName

ts.write nName

ts.close



Select Case nName



Case "siebel-xmlext-fields-req"

R.Open SQL, Conn, 3, 1, &H0001

domDoc.save (server.MapPath("init1.xml"))

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-fields-ret>"

For Each F in R.Fields

  Response.Write "<support field='"& F.Name &"'/>"

Next

Response.Write "</siebel-xmlext-fields-ret>"

R.Close



Case "siebel-xmlext-query-req"


'This section of SelectCase is for the Query Request

dim attVal1(25)

dim attName1(25)

'set mainNodes = root.childNodes

set matchNodes = domDoc.SelectNodes("siebel-xmlext-query-req/match")

For each matchNode in matchNodes

  attVal1(x) = matchNode.text

  set attribs = matchNode.attributes

  set attrib = attribs(0)

  attName1(x) = attrib.nodeValue

x = x +1

next

x = x - 1

for y=0 to x

  if not ((x-y)>0) then

     sWhere = sWhere & attName1(y) & " = " & """" & attVal1(y) & """"

  else

     sWhere = sWhere & attName1(y) & " = " & """" & attVal1(y) & """ AND"

  end if

next



'setting the WHERE clause in order to query the correct recordset


if  sWhere="" then

SQLwhere = SQL

else

SQLwhere = " WHERE " & sWhere

SQLwhere = SQL + SQLwhere

end if

'Response.Write SQLwhere

R.Open SQLwhere, Conn, 3, 1, &H0001


'for debugging

domDoc.save (server.MapPath("init2.xml"))


'build response stream by iterating through the recordset

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-query-ret>"

'ts.write "<?xml version="1.0" encoding="UTF-8"?>"

'ts.write "<siebel-xmlext-query-ret>"



While Not R.EOF

  Response.Write "<row>"

  'ts.write "<row>"

For Each F in R.Fields

  Response.Write "<value field="""& F.Name &""">"& F.Value &"</value>"

  'ts.write "<value field="""& F.Name &""">"& F.Value &"</value>"

Next

Response.Write "</row>"

'ts.write "</row>"

R.MoveNext

Wend

Response.Write "</siebel-xmlext-query-ret>"

'ts.write "</siebel-xmlext-query-ret>"

R.Close



Case "siebel-xmlext-preinsert-req"

'Section for PreInsert



Response.Write "<siebel-xmlext-preinsert-ret>"

Response.Write "<row></row>"

Response.Write "</siebel-xmlext-preinsert-ret>"

Case "siebel-xmlext-insert-req"



'Section for Insert



R.Open SQL, Conn, 3, 3, &H0001

dim attVal(25)

dim attName(25)

set mainNodes = root.childNodes

set matchNodes = domDoc.SelectNodes("siebel-xmlext-insert-req/row/value")

For each matchNode in matchNodes

attVal(x) = matchNode.text



set attribs = matchNode.attributes

set attrib = attribs(0)

attName(x) = attrib.nodeValue



x = x +1

next



x = x - 1

for y=0 to x

if not ((x-y)>0) then

sFields = sFields & """" & attName(y) & """"

sValues = sValues & """" & attVal(y) & """"

else

sFields = sFields & """" & attName(y) & """, "

sValues = sValues & """" & attVal(y) & """, "

end if

next

'ts.write sFields

'ts.write sValues

if (R.Supports(&H01000400)) then

R.AddNew Array(sFields), Array(sValues)

end if



R.Update

R.Close



Case "siebel-xmlext-delete-req"

'Section for Delete



End Select



'cleaning up the objects in memory

'ts.close

set root = Nothing

set domDoc = Nothing

set ts = Nothing

set fs = Nothing

Set R = Nothing

Conn.Close

Set Conn = Nothing

%>

ModelValueBySector.asp

Use the following sample ASP to test retrieving data for the Sector Allocation view.

<%@ EnableSessionState=False Language=VBScript %>

<% option explicit %>

<%

Dim Conn

Dim SQL

Dim R

Dim F

Dim RecsAffected

Dim aConnectionString


aConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _

  & "Data Source=C:\Inetpub\ibd\mdb.mdb"


Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Mode = 3

Conn.ConnectionString = aConnectionString

Conn.CursorLocation = 3

Conn.Open

SQL="SELECT * from ModelValueBySector"

Set R=Server.CreateObject("ADODB.Recordset")



dim v

dim fs

dim ts

dim sReq

Dim aPath 

Dim aLogFile

dim item



aPath = Request.ServerVariables("PATH_TRANSLATED") 

'Response.Write aPath



' strip the file name from the path 

aPath = Left(aPath, instrRev(aPath, "\"))

' add the log file name

aLogFile = aPath & "\log\ModelValueBySector.txt"



set fs = Server.CreateObject("Scripting.FileSystemObject")

set ts = fs.OpenTextFile(aLogFile, 8, True, 0)



for each item in Request.ServerVariables

  ts.write item

  ts.write Request.ServerVariables(item)



next



dim domDoc

dim aFilename

set domDoc = Server.CreateObject("MSXML.DOMDocument")

domDoc.async = false

'domDoc.setProperty("ServerHTTPRequest")=true

domDoc.load(Request)



dim node

dim nodes

dim mainNode

dim mainNodes

dim matchNode

dim matchNodes

dim attribs

dim attrib

dim SQLwhere

Dim root

dim SQLinsert

dim SQLfields

dim SQLvalues

dim sWhere

dim x

dim y

dim sFields

dim sValues


set root = domDoc.documentElement



dim nName

dim inputText

dim data



'inputText = Request.Form("textInput")

nName = root.nodeName

ts.write nName

ts.close



Select Case nName



Case "siebel-xmlext-fields-req"

R.Open SQL, Conn, 3, 1, &H0001

domDoc.save (server.MapPath("init1.xml"))

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-fields-ret>"

For Each F in R.Fields

  Response.Write "<support field='"& F.Name &"'/>"

Next

Response.Write "</siebel-xmlext-fields-ret>"

R.Close



Case "siebel-xmlext-query-req"



'This section of SelectCase is for the Query Request

dim attVal1(25)

dim attName1(25)

'set mainNodes = root.childNodes

set matchNodes = domDoc.SelectNodes("siebel-xmlext-query-req/match")

For each matchNode in matchNodes

  attVal1(x) = matchNode.text

  set attribs = matchNode.attributes

  set attrib = attribs(0)

  attName1(x) = attrib.nodeValue

x = x +1

next


x = x - 1


for y=0 to x

  if not ((x-y)>0) then

     sWhere = sWhere & attName1(y) & " = " & """" & attVal1(y) & """"

  else

     sWhere = sWhere & attName1(y) & " = " & """" & attVal1(y) & """ AND"

  end if

next



'setting the WHERE clause in order to query the correct recordset



if  sWhere="" then

SQLwhere = SQL

else

SQLwhere = " WHERE " & sWhere

SQLwhere = SQL + SQLwhere

end if

'Response.Write SQLwhere

R.Open SQLwhere, Conn, 3, 1, &H0001



'for debugging

domDoc.save (server.MapPath("init2.xml"))



'build response stream by iterating through the recordset

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-query-ret>"

'ts.write "<?xml version="1.0" encoding="UTF-8"?>"

'ts.write "<siebel-xmlext-query-ret>"



While Not R.EOF

  Response.Write "<row>"

  'ts.write "<row>"

For Each F in R.Fields

  Response.Write "<value field="""& F.Name &""">"& F.Value &"</value>"

  'ts.write "<value field="""& F.Name &""">"& F.Value &"</value>"

Next

Response.Write "</row>"

'ts.write "</row>"

R.MoveNext

Wend

Response.Write "</siebel-xmlext-query-ret>"

'ts.write "</siebel-xmlext-query-ret>"

R.Close



Case "siebel-xmlext-preinsert-req"



'Section for PreInsert

Response.Write "<siebel-xmlext-preinsert-ret>"

Response.Write "<row></row>"

Response.Write "</siebel-xmlext-preinsert-ret>"



Case "siebel-xmlext-insert-req"



'Section for Insert



R.Open SQL, Conn, 3, 3, &H0001

dim attVal(25)

dim attName(25)

set mainNodes = root.childNodes

set matchNodes = domDoc.SelectNodes("siebel-xmlext-insert-req/row/value")

For each matchNode in matchNodes

attVal(x) = matchNode.text



set attribs = matchNode.attributes

set attrib = attribs(0)

attName(x) = attrib.nodeValue



x = x +1

next



x = x - 1

for y=0 to x

if not ((x-y)>0) then

sFields = sFields & """" & attName(y) & """"

sValues = sValues & """" & attVal(y) & """"

else

sFields = sFields & """" & attName(y) & """, "

sValues = sValues & """" & attVal(y) & """, "

end if



next

'ts.write sFields

'ts.write sValues

if (R.Supports(&H01000400)) then

R.AddNew Array(sFields), Array(sValues)

end if



R.Update

R.Close



Case "siebel-xmlext-delete-req"

'Section for Delete

End Select



'cleaning up the objects in memory

'ts.close

set root = Nothing

set domDoc = Nothing

set ts = Nothing

set fs = Nothing

Set R = Nothing

Conn.Close

Set Conn = Nothing

%>

holdings.asp

Use the following sample ASP to test retrieving data for the Aggregated Holdings view.

<%@ EnableSessionState=False Language=VBScript %>

<% option explicit %>

<%

Dim Conn

Dim SQL

Dim R

Dim F

Dim RecsAffected

Dim aConnectionString



aConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _

  & "Data Source=C:\Inetpub\ibd\mdb.mdb"



Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Mode = 3

Conn.ConnectionString = aConnectionString

Conn.CursorLocation = 3

Conn.Open

SQL="SELECT * from Holdings"

Set R=Server.CreateObject("ADODB.Recordset")



dim v

dim fs

dim ts

dim sReq

Dim aPath 

Dim aLogFile

dim item



aPath = Request.ServerVariables("PATH_TRANSLATED") 

'Response.Write aPath



' strip the file name from the path 

aPath = Left(aPath, instrRev(aPath, "\")) 

' add the log file name

aLogFile = aPath & "\log\Holding.txt"



set fs = Server.CreateObject("Scripting.FileSystemObject")

set ts = fs.OpenTextFile(aLogFile, 8, True, 0)



'for each item in Request.ServerVariables

  'ts.write item

  'ts.write Request.ServerVariables(item)

'next

dim domDoc

dim aFilename

set domDoc = Server.CreateObject("MSXML.DOMDocument")

domDoc.async = false

'domDoc.setProperty("ServerHTTPRequest")=true

domDoc.load(Request)




dim node

dim nodes

dim mainNode

dim mainNodes

dim matchNode

dim matchNodes

dim attribs

dim attrib

dim SQLwhere

Dim root

dim SQLinsert

dim SQLfields

dim SQLvalues

dim sWhere

dim x

dim y

dim sFields

dim sValues



set root = domDoc.documentElement



dim nName

dim inputText

dim data



'inputText = Request.Form("textInput")

nName = root.nodeName

'ts.write nName

'ts.close



Select Case nName



Case "siebel-xmlext-fields-req"

R.Open SQL, Conn, 3, 1, &H0001

domDoc.save (server.MapPath("initHold1.xml"))

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-fields-ret>"

For Each F in R.Fields

  Response.Write "<support field='"& F.Name &"'/>"

Next

Response.Write "</siebel-xmlext-fields-ret>"

R.Close



Case "siebel-xmlext-query-req"


'This section of SelectCase is for the Query Request

dim attVal1(25)

dim attName1(25)



set mainNodes = root.childNodes

ts.writeline "Document have MainNodes: " & mainNodes.length

Dim z

z = 0

For each matchNode in MainNodes

  'attVal1(z) = matchNode.text

  'set attribs = matchNode.attributes

  'set attrib = attribs(0)

  'attName1(z) = attrib.nodeValue

'ts.writeline

ts.writeline "MainNode " & z

'ts.write z

ts.writeline "Main Node Name: " & matchNode.nodeName

ts.writeline "Main Node type: " & matchNode.nodeType

ts.writeline "Main Node value: " & matchNode.nodeValue

'ts.writeline "match Node data: " & matchNode.data

ts.writeline "Main line text: " & matchNode.text

'ts.write attrib.nodeValue



z = z +1

next



set matchNodes = root.SelectNodes("search-string")

ts.writeline "MatchNodes in document are : " & matchNodes.length

x = 0



For each matchNode in matchNodes



ts.writeline "Match string is :" & matchNode.text

sWhere = matchNode.text

x = x +1

next



ts.writeline "This is sWhere " & sWhere

'setting the WHERE clause in order to query the correct recordset



if  sWhere="" then

SQLwhere = SQL

else

SQLwhere = " WHERE " & sWhere

SQLwhere = SQL + SQLwhere

end if

'Response.Write SQLwhere

R.Open SQLwhere, Conn, 3, 1, &H0001



'for debugging

domDoc.save (server.MapPath("initHold2.xml"))



'build response stream by iterating through the recordset

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-query-ret>"

'ts.write "<?xml version="1.0" encoding="UTF-8"?>"

'ts.write "<siebel-xmlext-query-ret>"



	While Not R.EOF

  Response.Write "<row>"

  'ts.write "<row>"

For Each F in R.Fields

  Response.Write "<value field="""& F.Name &""">"& F.Value &"</value>"

  	'ts.write "<value field="""& F.Name &""">"& F.Value &"</value>"

Next

Response.Write "</row>"

'ts.write "</row>"

R.MoveNext

Wend

Response.Write "</siebel-xmlext-query-ret>"

'ts.write "</siebel-xmlext-query-ret>"

R.Close



Case "siebel-xmlext-preinsert-req"


'Section for PreInsert

Response.Write "<siebel-xmlext-preinsert-ret>"

Response.Write "<row></row>"

Response.Write "</siebel-xmlext-preinsert-ret>"



Case "siebel-xmlext-insert-req"


'Section for Insert

Case "siebel-xmlext-delete-req"

'Section for Delete



End Select



'cleaning up the objects in memory

ts.close

set root = Nothing

set domDoc = Nothing

set ts = Nothing

set fs = Nothing

Set R = Nothing

Conn.Close

Set Conn = Nothing

%>