Andornot Consulting Inc.
Home Page
Home Page
 |  | 

Thursday, December 13, 2007

Running Inmagic Genie without Content Server

Why not hack Genie this holiday season? Chestnuts roasting on an open fire, Jack Frost nipping at your nose, Genie excised from Content Server and forced to run on DB/Text Webpublisher... Ho ho ho!

This was my first run at getting Genie to work with DB/Text Webpublisher instead of CS Webpublisher. There is definitely room for improvement, but this was the proof of concept.

There are just two tweaks, neither of which involve access to Genie's source code: 1) a redirect from /ics-wpd/exec/icswppro.dll to /dbtw-wpd/exec/dbtwpub.dll, and 2) alteration of Genie SOAP file locations in web.config. Oh, and of course, one must recreate all the Genie textbases in DB/Textworks. Alright, three tweaks.

httpRedirect

I did this on a Vista Ultimate machine, so the specifics are valid for IIS 7 only, but the concept is still applicable to IIS 5 or 6.

Internally, Genie has the CS Webpublisher ISAPI location hard-coded all over the place. Since it is not possible to override these within the Genie application, we have to do it externally, which is where HTTP redirect comes in.  Thus Genie merrily continues to make requests to CS Webpublisher, but we re-route all those requests to DB/Text Webpublisher.

In applicationHost.config, I enabled httpRedirect with a response status of "Temporary" (we'll see why in a minute) and added a wildcard to route CS Webpublisher requests to DB/Text Webpublisher:

<httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Temporary">
    <add wildcard="/ics-wpd/exec/icswppro.dll" destination="/dbtw-wpd/exec/dbtwpub.dll$Q" />
</httpRedirect>

The $Q placeholder sends all querystring variables to the new URL, which covers GET requests. The response status "Temporary" (HTTP status code 307) is the only response status which sends POST requests on to the new URL. Permanent (301) and Found (302) will not. So that covers POST requests.

This redirect is a client-side redirect, and as such is not terrifically efficient, but it works. A server-side URL rewrite would be a vast improvement.

SOAP File locations

When Genie installs, it places a pile of SOAP files for its textbases in CS Webpublisher's \SOAP folder. We move these to DB/Text Webpublisher's \SOAP folder instead.

e.g.

c:\program files\inmagic\icsweb\soap\*.*

to

c:\program files\inmagic\webpubpro\soap\*.*

Then, in Genie's web.config, find the section called <Genie.Properties.Settings> and modify the URLs for the *.icx files to point to DB/TextWebpublisher's /dbtw-wpd/soap/ location:

<setting name="Genie_BorrowerSOAP_BORROWER_SOAP" serializeAs="String">
    <value>http://localhost/dbtw-wpd/soap/BORROWER_input.icx</value>
</setting>

Textbases

To create a DB/Text database from a CS version, create a textbase structure backup, which produces a file with a *.cbb extension. Rename the .cbb extension to .tbb. Create a new textbase from DB/Textworks and restore from the .tbb file. Now you have a DB/Text textbase whose structure matches its CS version exactly.

Then export data from the CS database as a .dmp, and use the "Load Textbase" feature in DB/Text to import it to your new DB/Textworks database. Export form elements from the CS textbase and import them into the DB/Text database.

It takes 5-10 minutes to completely re-create a CS textbase in DB/Textworks.

Conclusion

The above is an intellectual exercise, and I'm not sure what benefit might be gained by doing it, but it proves that it is possible to run Genie on DB/Text instead of Content Server, without access to Genie source code.

3 Comments:

Anonymous danny said...

Hmmm... may be something like IIS Mod-Rewrite would help with redirections and url rewriting. Although the way it works is more of apache style, it's quite efficient and works with all IIS versions.

11:05 AM  
Anonymous Soutron said...

Very nice.
I just tryed it on a test server2003, and it worked with a few mods....when i say worked it allowed me to login with a DB textbase user name.

But a very nice concept, somthing i would like to see come to life.

when searching i received the below error:

Server Error in '/InmagicGenie' Application.
XmlWppRequest, The 'input' start tag on line 12 does not match the end tag of 'form'. Line 13, position 3.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: XmlWppRequest, The 'input' start tag on line 12 does not match the end tag of 'form'. Line 13, position 3.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[Exception: XmlWppRequest, The 'input' start tag on line 12 does not match the end tag of 'form'. Line 13, position 3.]
Genie.Utilities.Utils.XmlWppRequest(String queryParams) +517
Genie.ReportControl.DoQuery() +3313
Genie.ReportControl.Page_Load(Object sender, EventArgs e) +958
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

5:19 AM  
Blogger Peter Tyrrell said...

On the XmlWppRequest error, I would guess that the xml returned by Webpublisher is reporting some Webpublisher-level error, but is using invalid xml to do so. (I.e. the error message itself contains some html.) It's happened to me before, though not with this particular situation. Just a guess.

9:25 AM  

Post a Comment

<< Home