Siebel Portal Framework Guide > Web Engine HTTP TXN Business Service > Scenario >

Sample HTTP TXN BS Code



Function Service_PreInvokeMethod (MethodName As String, Inputs As PropertySet, Outputs As PropertySet) As Integer

If MethodName = "getHTTPVars" Then

Dim FS As Object

Dim oFile As Object

Dim oBS As Service

Dim In As PropertySet

Dim Out As PropertySet

Dim oChild As PropertySet

Set fs = CreateObject("Scripting.FileSystemObject")

If fs.FileExists("c:\testfile.txt") Then

Set oFile = fs.OpenTextFile("c:\testfile.txt", 8,0)

Else

Set oFile = fs.CreateTextFile("c:\testfile.txt", True)

End If

Set oBS = theApplication.GetService("Web Engine HTTP TXN")

Set In = theApplication.NewPropertySet()

Set Out = theApplication.NewPropertySet()

oFile.WriteLine("----Headers----")

oBS.InvokeMethod "GetAllRequestHeaders", In, Out

strName = Out.GetFirstProperty()

While strName <> ""

oFile.WriteLine(strName & " : " & Out.GetProperty(strName) )

strName = Out.GetNextProperty()

Wend

In.Reset

Out.Reset

oFile.WriteLine("----URL Params----")

oBS.InvokeMethod "GetAllRequestParameters", In, Out

strName = Out.GetFirstProperty()

While strName <> ""

oFile.WriteLine(strName & " : " & Out.GetProperty(strName) )

strName = Out.GetNextProperty()

Wend

In.Reset

Out.Reset

oFile.WriteLine("----Cookies----")

oBS.InvokeMethod "GetAllRequestCookies", In, Out

For nChild = 0 To Out.GetChildCount() - 1

Set oChild = Out.GetChild(nChild)

strName = oChild.GetFirstProperty()

oFile.WriteLine("TYPE : " & oChild.GetType())

oFile.WriteLine("VALUE : " & oChild.GetValue())

While strName <> ""

oFile.WriteLine(strName & " : " & oChild.GetProperty(strName) )

strName = oChild.GetNextProperty()

Wend

Next nChild

oFile.Close

Set oChild = Nothing

Set oFile = Nothing

Set fs = Nothing

Service_PreInvokeMethod = CancelOperation

TheApplication.GotoView "Home Page View (WCC)", Nothing

Else

Service_PreInvokeMethod = ContinueOperation

End If

End Function


 Siebel Portal Framework Guide
 Published: 09 September 2004