This would seem pretty straight forward, but I cannot seem to get this to work. I have a .NET aspx page and I want to perform an HTTP POST to a Domino script agent. My ASPX page is simple for right now:
Dim session As New NotesSession
Dim db As notesdatabase
Dim doc As NotesDocument
Dim doc2 As notesdocument
Set doc = session.DocumentContext
Set db=session.CurrentDatabase
Set doc2=db.createdocument
Call doc2.replaceitemvalue("Form", "main")
Call doc2.replaceitemvalue("testfield", doc.Request_Content(0))
Call doc2.save(True,True)
End Sub
This agent has a trigger of Agent List and Target of None.
The ACL has Anonymous with Editor access. The form in the database has one field called “testfield”.
Does anyone see a reason why documents are not being created? I’ve checkedthe log and it generates no errors.
Subject: RE: HTTP Post to Domino agent from .NET form
I actually have the ACL wide open for Anonymous and I’m using the Run on Behalf Of field on the agent properties and it’s set to an admin ID that we use for all agents.
I really need to get this working so I can show the “majority” here that Domino plays well with others. I’m going to have an ASPX page with about 50 fields on it and I need to post the form to a Domino agent, have that agent parse the fields once posted and then process them into Domino databases. Is this even possible? I don’t want to use 50 query string variables and use a HTTP GET instead. Our standard is POST.
Subject: RE: HTTP Post to Domino agent from .NET form
Stan, I never did get this to work. Is your ASPX page on the save server as your Domino agent? Mine are in totally different environments. I found this article that makes it appear as though posting from .NET to another system is not easy to pull off.
If you have any other ideas I’d love to hear them. I’m almost ready to use a GET instead, but I hate to have to deal with the cumbersome querystring that will result. It’s going to be a monster in length.
Subject: RE: HTTP Post to Domino agent from .NET form
Other nuggets of information: when I go to that agent URL manually in IE, it creates a document in the database…just with no values, which is what I’d expect. However, it does create the document. Also, my aspx project is on my local machine, so it’s running from localhost. Would that have any bearing? I wouldn’t see why it would, but I figured I’d throw it out there. Thanks.
Subject: RE: HTTP Post to Domino agent from .NET form
That tells me that it’s not even being triggered from your aspx page. You can put a Msgbox(“Agent starting…”) statement at the beginning of your agent to see if its being triggered. The message will show on the domino console.