Agent and OLE Object: Serious Problem

Hi all. I´m again with a very complex cuestion. “Please” help me.

  • I´ve a web agent (A), triggered in the WebQueryOpen event on my form (F).

  • This agent (A) perform an action and return a value (V) on a field (I) in the context document (D).

This is the code:

Sub Initialize

Dim doc As notesdocument

Dim session As New notessession

Dim XMLList() As String,x As Variant, i As Integer

Dim xmlapp As Variant,sourceFile As Variant



Set doc = session.DocumentContext



sourceFile = "http://xxx/yyy.asmx/Function?sP=AAA"

Set xmlapp = CreateObject("Microsoft.XMLDOM")

xmlapp.async = False

xmlapp.load(sourceFile)



Set x = xmlapp.getElementsByTagName("short")

Redim XMLList(1 To x.length)



For i = 1 To x.length

	XMLList(i)=(x.item(i-1).text)

Next



doc.retval = XMLList(1)

Exit Sub

End Sub

The problem is that after the execution, the field “retval” in the document has no values.

This functions works OK in the NotesClient.

Some ideas that can help me? Please, is very important.

Thanks in avance.

Subject: Agent and OLE Object: Serious Problem

You probably need to upgrade the security level of the agent to 2.

I believe the COM stuff is restricted.

Subject: RE: Agent and OLE Object: Serious Problem

I´ve upgrade the security level of the agent yet (to level 2).Any other idea?

Thanks!

Subject: RE: Agent and OLE Object: Serious Problem

Well, I guess you need to see if the value is even getting set… when run on the server, msgbox statements in an agent output to the console - add some to the agent to see if the value even gets computed correctly.

Subject: Agent and OLE Object: Serious Problem

This works in the client and not on the server - that suggest a difference between the configuration of client and server -

is Microsoft.XMLDOM registered on the server? It comes with IE 5. on win2k, but that doesn’t mean that it’s still there.

Perhaps you should repair/upgrade/reinstall IE in the server.

Subject: Agent and OLE Object: Serious Problem

xmlapp.load(param) needs to use the Call keyword. If you don’t use Call, you can’t use parentheses around the method’s arguments if the result is unassigned.

Subject: RE: Agent and OLE Object: Serious Problem

Thanks Stan, but the error raise 2 lines up, in “Set xmlapp = CreateObject(“Microsoft.XMLDOM”)” sentence.