Inet_OI_XML Usage From Web - Can't Do Custom Select (OpenInsight 32-bit Specific)
At 05 AUG 2008 04:26:52PM Steve Botes wrote:
OICGI2.EXE is working on an IIS server and the goal is to allow for the retrieval of data from OI using XML. I.e. "Get all inventory categories of a certain type".
According to the help file, Inet_OI_XML can be used from either a web browser or another RBasic program. I wrote a Inet RBasic commuter module to add a layer of abstraction between Inet_OI_XML and the browser.
If I use the XML Workspace to build a XML Publisher entry this statement works just fine from a browser:
retval=Inet_OI_XML("", "", "c:\master8\xml_products", "", "", "GETPRODUCTS", 0)
The problem is I want to be able to do a select to limit the records returned. I can specify selection criteria in the XML Publisher record but it isn't dynamic. So I tried omitting the XML Publisher template and specify a LIST and SELECT statement:
xmlLIST=LIST INVENTORY CATEGORY'
xmlSELECT=SELECT INVENTORY WITH CATEGORY EQ "' : CAT : '"'
retval=Inet_OI_XML("", xmlLIST, "c:\temp\xml_products", xmlSELECT, "", "", 1)
The above statement does not work from a browser. The program crashes at the Inet_OI_XML call with no error. The statement will work if I run it from inside OpenInsight. The last param bHideMessages doesn't appear to have any influence on hiding the processing message that appears when run from OpenInsight.
How can I programmatically do a custom select from a web browser using Inet_OI_XML?
At 08 AUG 2008 12:17PM psimonsen@srpcs.com's Paul Simonsen wrote:
Steve,
Although I'm not familiar with the Inet_OI_XML process, I'll try to lend a hand. My only guess to why the Inet_OI_XML process (which works when called directly from within OI but not when indirectly called from the web) is not working would be either a system message is being fired of some kind (syntax error, system status message, etc) or it requires the presentation server to be running.
As for a possible work around, you could try this. Since the Inet_OI_XML process appears to work in conjunction with the XML Workspace, you could receive the dynamic selection criteria and update the XML Workspace record's Field 8 with the updated selection criteria. The record is stored in the SYSREPOSXML table under the key structure of APPID*EXPORT*GETPRODUCTS.
Hope this helps you a little further down the programming road.
psimonsen@srpcs.com
At 13 AUG 2008 02:14PM Steve Botes wrote:
I think you are right about a system message being fired which causes it to stop processing when called from the web. When called from OI Inet_OI_XML displays a processing message in a dialog box. I haven't been able to suppress this and since the presentation layer isn't running it must crash.
The work around might work but I'm afraid it will cause some concurrency issues if there are multiple custom selects. Perhaps I can copy the record to a temp record, insert the custom select, and then delete the temporary export record when I'm finished. I'll keep you posted, thanks for the idea.