webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

TAMINOLIB.JS in ASP

webMethods Community Member

webMethods Community MemberTue March 19, 2002 10:59 AM

  • 1.  TAMINOLIB.JS in ASP

    Posted Tue March 12, 2002 11:35 AM

    Hello!

    How should I use this js library in my VBScript using ASP?

    I’ve been trying like this example.ASP:

    <%
    Set PageSize = 0
    Set DataBase = “http://localhost/tamino/database/col
    Set Query = “dok”
    Set Client = Server.CreateObject(“TaminoClient(DataBase, PageSize)”)
    Set XMLObject = Client.query(Query)
    Set XSLObject = Server.CreateObject(“Microsoft.XMLDOM”)
    If (XSLObject.loadXML(str) <> 0) Then
    Response.Write XSLObject.parseError.reason
    Else
    Response.Write XMLObject.DOM.transformNode(XSLObject.documentElement)
    End If

    Response.End

    %>

    Line:
    Set Client = Server.CreateObject(“TaminoClient(DataBase, PageSize)”)

    doesn’t work. :frowning:

    How should I create object TaminoClient in ASP file? :eek:

    Regards
    Dariusz Baumann


    #webMethods
    #API-Management
    #webMethods-Tamino-XML-Server-APIs


  • 2.  RE: TAMINOLIB.JS in ASP

    Posted Tue March 12, 2002 03:08 PM

    Hard stuff.

    CreateObject only works on something that has been registered as a DLL.

    Your options are IMHO

    1)Write the ASP page in Jscript and use TaminoClient.js (with added <% and %>
    2)Use the Tamino Active X Control and VBScript
    3)(Theoretically)

    write a Jscript function

    function newTaminoClient()
    {
    return (new TaminoClient());
    }
    </SCRIPT
    and rewrite your code something like this

    Set PageSize = 0
    Set DataBase = “http://localhost/tamino/database/col
    Set Query = “dok”
    Set Client = newTaminoClient()
    Set Client.pageSize=PageSize
    Set Client.XMLDB=Database
    Set XMLObject = Client.query(Query)
    Set XSLObject = Server.CreateObject(“Microsoft.XMLDOM”)
    If (XSLObject.loadXML(str) <> 0) Then
    Response.Write XSLObject.parseError.reason
    Else
    Response.Write XMLObject.DOM.transformNode(XSLObject.documentElement)
    End If

    Response.End

    This MIGHT work - but it scares me a bit


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 3.  RE: TAMINOLIB.JS in ASP

    Posted Wed March 13, 2002 12:46 PM

    Hello again!

    I have been trying in my file example.ASP, like this:


    function newTaminoClient()
    {
    return (new TaminoClient());
    }
    </SCRIPT

    <%
    dim PageSize, DataBase, Query, Client, XMLObject
    PageSize = 0
    DataBase = “http://localhost/tamino/database/col
    Query = “dok”
    Client = newTaminoClient()
    Client.pageSize=PageSize
    Client.XMLDB=Database
    XMLObject = Client.query(Query)
    Set XSLObject = Server.CreateObject(“Microsoft.XMLDOM”)
    If (XSLObject.loadXML(str) <> 0) Then
    Response.Write XSLObject.parseError.reason
    Else
    Response.Write XMLObject.DOM.transformNode(XSLObject.documentElement)
    End If
    Response.End
    %>

    but it doesn’t work. IE6 returned message error “Type mismatch” in line

    Client = newTaminoClient()

    :frowning: :frowning: :frowning:

    so, it seems like impossible to return object of type TaminoClient into VBScript in file ASP in this way !? :confused: :confused:

    Any ideas how to fix this code will be appreciated. :slight_smile:

    Best Regards from POLAND
    Dariusz Baumann


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 4.  RE: TAMINOLIB.JS in ASP

    Posted Wed March 13, 2002 02:08 PM

    I don’t know if this solves your problem, but this is something worth to check:
    Make sure you have MSXML3.DLL installed on your system (check if winnt\system32\msxml3.dll exists). If it doesn’t, the JSCript API will not work and the error messages are not very obvious.
    BTW: Having only MSXML4.DLL does not help - it does not include all MSXML3.DLL functionality.


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 5.  RE: TAMINOLIB.JS in ASP

    Posted Wed March 13, 2002 02:19 PM

    I can’t think why this wouldn’t work.

    As I said before - I would use the Tamino Active X control if you want to write using VBScript - lots of people have done this successfully.

    Or do it all in Jscript


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods


  • 6.  RE: TAMINOLIB.JS in ASP

    Posted Thu March 14, 2002 11:52 AM

    I don’t know if this solves your problem, but this is something worth to check:
    Make sure you have MSXML3.DLL installed on your system (check if winnt\system32\msxml3.dll exists).

    I has checked and c:\winnt\system32\msxml3.dll exists and it is loaded. :eek:

    So, why is type mismatch on ASP page? :frowning:

    Regards
    Dariusz Baumann


    #API-Management
    #webMethods
    #webMethods-Tamino-XML-Server-APIs


  • 7.  RE: TAMINOLIB.JS in ASP

    Posted Thu March 14, 2002 12:04 PM

    I can’t think why this wouldn’t work.

    On your machine it works? :o

    As I said before - I would use the Tamino Active X control if you want to write using VBScript

    So tell me what should I do to make this ASP page working good! :confused:

    I should use ISAPI filters like: modiis.dll and NodeLevelUpdate.dll? :confused: :confused:
    If yes please write in simple steps what should I do. :slight_smile: Thanks for support!

    Or do it all in Jscript

    Must I rewrite from beginning TaminoLib.js in JScript? :eek: :o :mad: :confused: :confused:

    Regards,
    Dariusz Baumann


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 8.  RE: TAMINOLIB.JS in ASP

    Posted Thu March 14, 2002 03:31 PM

    Here’s a small example of VBScript ASP Page using the Tamino ActiveX control. Steps to implement:

    • Register the Tamino ActiveX control on your server.The command to do this is “regsvr32 TaminoX.ocx” from a command prompt in the directory where taminox.ocx exists (eg .\Tamino 3.1.1.1\SDK\ActiveX).

    • Install the attached asp page and stylesheet in your root web directory

    • Change the asp page “DataBase” field to point to your RealEstate database. Change the “DocumentID” field to match the ino:id of a Property record that exists.

    • Make sure the MSXML3 ActiveX is also registered on your server (see my FAQ at FAQ for how to do this).

    • Load URL http:///prop3.asp into your browser

    HTH

    [This message was edited by Bill Leeney on 14 Mar 2002 at 15:17.]
    PropExample.zip (1.45 KB)


    #API-Management
    #webMethods
    #webMethods-Tamino-XML-Server-APIs


  • 9.  RE: TAMINOLIB.JS in ASP

    Posted Thu March 14, 2002 04:05 PM

    First of all, Great thanks for example! :slight_smile:

    Here is the points what I have done:

    1) I registerd the Tamino ActiveX control on my server by executing the command “regsvr32 TaminoX.ocx” from a command prompt in the directory c:\program files\Software AG\Tamino 3.1.1.1\SDK\ActiveX).

    2) I installed the attached YOUR asp page and stylesheet in my root web directory “c:\inetpub\wwwroot\activeX”

    3) I changed the asp page “DataBase” field to point to my database and I change the “DocumentID” field to match the ino:id of a my property record that exists.

    4) I made sure the MSXML3 ActiveX is also registered on my server.

    5) I loaded URL http://localhost/activeX\prop3.asp into my browser, and I got error message that “requested object cannot be reached”

    :confused: :mad: :eek:

    What can I else do to fix this problem? :frowning:

    Best Regards from POLAND
    Dariusz Baumann


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 10.  RE: TAMINOLIB.JS in ASP

    Posted Thu March 14, 2002 04:14 PM

    OK, so what happens in each of these cases:


    Thanks


    #webMethods-Tamino-XML-Server-APIs
    #API-Management
    #webMethods


  • 11.  RE: TAMINOLIB.JS in ASP

    Posted Thu March 14, 2002 04:52 PM
    1. http://localhost

      Opens my local page:
      http://darekb/localstart.asp :slight_smile:

      2) http://localhost/activex/Property.xsl (You should see the stylesheet displayed as xml document

      Yes, It works, but my url is different because I loaded in xsl style into TAMINO. :slight_smile:

      3) http://server/tamino/database/Property/Property/@n
      where n is your chosen ino:id (you should see your Property document displayed as xml)

      It works pretty good. :slight_smile:

      So, what can I do else to fix my problem with ASP? :slight_smile:

      Thanks for YOUR support!

      Best Regards from POLAND
      Dariusz Baumann


    #API-Management
    #webMethods
    #webMethods-Tamino-XML-Server-APIs


  • 12.  RE: TAMINOLIB.JS in ASP

    Posted Thu March 14, 2002 05:20 PM

    So now it looks like a problem loading the stylesheet. The supplied example uses Server.MapPath to append the physical file system location of the asp page to the literal “Property.xsl” to determine where to find the stylesheet in the server’s file system. What exactly is your XSLDoc.load statement? If you’re loading from a URL you should drop the “Server.MapPath” part and just use

    XSLDoc.Load “your URL”

    If it still doesn’t work, to debug further please add a line of code to the example asp page as shown:

    code:

    If XSLDoc.parseError <> 0 Then
    Response.Write "Error loading stylesheet: "
    Response.Write XSLDoc.parseError.reason
    Else
    Response.Write XMLDoc.transformNode(XSLDoc)
    End If


    Then rerun and tell us exactly what error messages you get. This will confirm whether or not the problem is in loading the stylesheet object.


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 13.  RE: TAMINOLIB.JS in ASP

    Posted Fri March 15, 2002 07:38 AM

    Stylesheet load problem?

    I think yes! But how to fix it?

    So now it looks like a problem loading the stylesheet. The supplied example uses Server.MapPath to append the physical file system location of the asp page to the literal “Property.xsl” to determine where to find the stylesheet in the server’s file system. What exactly is your XSLDoc.load statement? If you’re loading from a URL you should drop the “Server.MapPath” part and just use
    XSLDoc.Load “your URL”

    My URL is correct. I have been trying to load my stylesheet FROM DATABASE TAMINO ! This stylesheet EXISTS.

    If it still doesn’t work, to debug further please add a line of code to the example asp page as shown:
    Then rerun and tell us exactly what error messages you get. This will confirm whether or not the problem is in loading the stylesheet object.

    I HAVE WRITEEN THIS REASON MESSAGE ERROR ON MY FIRST POST. After adding, your line I got EXACTLY this error messages:

    "Error loading stylesheet
    System nie m


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods


  • 14.  RE: TAMINOLIB.JS in ASP

    Posted Fri March 15, 2002 09:42 AM

    A file system load is not the same as a http load when you are running server-side. There is an article at Microsoft that explains in some detail why loading xml over http using load method might not work. Can you please test my example as it was originally provided, using the server’s file system to store your stylesheet. That might not be want you want your application to do for real, but the purpose of the example is to demonstrate the use of the Tamino ActiveX control from VBScript, not to show you how to load a stylesheet from Tamino.

    If you want really must use http to load the stylesheet, you can try replacing the load code with:

    code:

    Set XSLConn = Server.CreateObject(“MSXML2.ServerXMLHTTP”)
    XSLConn.Open “GET”, “your URL”, False
    XSLConn.Send
    XSLDoc.loadXML XSLConn.responseText

    If XSLDoc.parseError <> 0 Then
    …as before…



    This might fix your problem.
    Thanks.


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 15.  RE: TAMINOLIB.JS in ASP

    Posted Fri March 15, 2002 12:35 PM

    Or even better, if the xml and the stylesheet are both in Tamino, use the ActiveX to get them both like this:

    code:

    <%@ Language=VBScript %>
    <%
    Dim xmlPageSize,xmlDatabase,xmlDocumentID,xmlClient,xmlDoc
    Dim xslPageSize,xslDatabase,xslDocumentID,xslClient,xslDoc

    xmlPageSize = 0
    xmlDataBase = “http://server/tamino/RealEstate/Property
    xmlDocumentID = “Property/@1
    Set xmlClient = Server.CreateObject(“TAMINOX.TaminoX1”)
    xmlClient.Initialize()
    xmlClient.csDatabaseURL(xmlDataBase)
    Set xmlDoc = xmlClient.getDocument(xmlDocumentID)

    xslPageSize = 0
    xslDataBase = “http://server/tamino/xml2/Stylesheets
    xslDocumentID = “xsl:stylesheet/@3
    Set xslClient = Server.CreateObject(“TAMINOX.TaminoX1”)
    xslClient.Initialize()
    xslClient.csDatabaseURL(xslDataBase)
    Set xslDoc = xslClient.getDocument(xslDocumentID)

    Response.Write xmlDoc.transformNode(xslDoc)

    Response.End

    %>



    HTH


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods


  • 16.  RE: TAMINOLIB.JS in ASP

    Posted Mon March 18, 2002 10:28 AM

    …or better…

    Better? :confused: For sure, it is NOT better idea! :o

    Your attached code about creating object TAMINOX doesn’t work, at all! :frowning: :frowning: :frowning:

    IE6PL displays “Required object xmlDoc”! :mad: :mad: :mad:

    By the way, Thanks a lot for support :slight_smile: , but sorry it doesn’t work your example! :frowning:

    How can I fix it this problem?

    Best Regards from POLAND
    Dariusz Baumann


    #webMethods
    #webMethods-Tamino-XML-Server-APIs
    #API-Management


  • 17.  RE: TAMINOLIB.JS in ASP

    Posted Mon March 18, 2002 01:55 PM

    A file system load is not the same as a http load when you are running server-side.

    You are right!

    NOW my project works with TAMINO, very good! :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:

    I changed my VBScript like this:
    -----------------------------------------------
    <%

    Dim DataBase, StyleSheet
    DataBase = “http://localhost/tamino/myDatabase/col?_xql=dok
    Query = “[surname=‘Baumann’]”
    Stylesheet = “http://localhost/tamino/myDatabase/col/style/First.xsl

    Set xmlcon = Server.CreateObject(“MSXML2.ServerXMLHTTP”)

    xmlcon.Open “GET”, DataBase+Query, False
    xmlcon.Send

    Set xmldoc = Server.CreateObject(“Microsoft.XMLDOM”)
    xmldoc.async = false
    xmldoc.loadxml xmlcon.responseText

    If xmldoc.parseError <> 0 Then
    Response.Write “Error loading data from TAMINO”
    Else
    Response.Write “OK loading data!”
    End If

    Set xslcon = Server.CreateObject(“MSXML2.ServerXMLHTTP”)
    xslcon.Open “GET”, StyleSheet, False
    xslcon.Send

    Set xsldoc = Server.CreateObject(“Microsoft.XMLDOM”)
    xsldoc.async = false
    xsldoc.loadxml xslcon.responseText

    If xsldoc.parseError <> 0 Then
    Response.Write “Error loading XSL stylesheet”
    Else
    Response.Write “OK loading stylesheet”
    Response.Write XMLDoc.transformNode(xsldoc.documentElement)
    End If
    Response.End
    %>
    -----------------------------------------------

    ONCE AGAIN great thanks a lot, Bill Leeney!

    Regards from POLAND
    Dariusz Baumann


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 18.  RE: TAMINOLIB.JS in ASP

    Posted Mon March 18, 2002 02:00 PM

    Hi,

    Hi Bil! :slight_smile:

    I think our conversation should be continued in private until we resolve
    your problem - the diagnostic process is probably not interesting to other
    people. When the issue is resolved, I’ll make a closing post.

    I think that it is ALMOST good time to closing this topic, but I have one doubt (about using “@” character to load stylesheet from TAMINO, properly). Read below! :slight_smile:

    In the last example I sent you, we create two instances of TAMINOX.TaminoX1,
    one for the xml and one for the xsl.
    These are populated from two URLs in my post, which relate to my server and
    must be changed for yours.

    First these two variables determine the source xml location:

    xmlDataBase = “http://server/tamino/RealEstate/Property
    xmlDocumentID = “Property/@1

    Presumably you changed these to reflect your actual document location?

    Yes, I changed it of course! :slight_smile:

    What happens if you post your values of these variables directly into a
    browser, separated only by a slash “/”, like this:

    http://server/tamino/RealEstate/Property/Property/@1 (substitute your actual
    data values of course).
    Do you see the xml you expect?

    Unfortunately, no! I cannot see any xml data!

    Similarly what happens if you attempt to access your stylesheet using the
    same technique and your values of xslDataBase and xslDocumentID?
    Do you see your stylesheet?

    I cannot load my stylesheet which is stored in TAMINO by character “@”. I don’t know how should I use this posibility. Can you help me?

    This is my FIXED script: :slight_smile:
    ------------------
    <%@ Language=VBScript %>

    <%
    Dim xmlPageSize, xmlDatabase, xmlDocumentID, xmlClient, xmlDocDim
    Dim xslPageSize, xslDatabase, xslDocumentID, xslClient, xslDoc
    xmlPageSize = 0
    xmlDataBase = “http://localhost/tamino/DataBase/col
    xmlDocumentID = “/dok/@10
    Set xmlClient = Server.CreateObject(“TAMINOX.TaminoX1”)
    xmlClient.Initialize()
    xmlClient.csDatabaseURL(xmlDataBase)
    Set xmlDoc = xmlClient.getDocument(xmlDocumentID)
    xslPageSize = 0
    xslDataBase = “http://localhost/tamino/DataBase/col/style
    xslDocumentID = “/First.xsl”
    Set xslClient = Server.CreateObject(“TAMINOX.TaminoX1”)
    xslClient.Initialize()
    xslClient.csDatabaseURL(xslDataBase)
    Set xslDoc = xslClient.getDocument(xslDocumentID)
    Response.Write xmlDoc.transformNode(xslDoc)
    Response.End
    %>
    ------------------

    NOW this project ALSO works using TAMINIX object, very good! :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:

    ONCE AGAIN great thanks a lot, Bill Leeney!

    Regards from POLAND
    Dariusz Baumann

    PS.

    1)

    In my script I used:
    xmlDocumentID = “/dok/@10
    instead of
    xmlDocumentID = “/dok/@1

    So, I don’t know why value 10 is good (value 1 is not good) and what from this value depends? Can you explain me? Thanks, Bill!

    2)

    I also used:
    xslDocumentID = “/First.xsl”
    instead of
    xslDocumentID = “/First.xsl/@value

    where value is for example 10. I have been trying from 1 to 20 value but none of these value wasn’t properly, so I coudln’t see any my stylesheet.

    Only when I used:
    xslDocumentID = “/First.xsl”
    I got my stylesheet.

    Can you explain me why it is and how should I use character “@” to load my stylesheet from TAMINO?

    Great thanks, for Your support, Bil! :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:


    #API-Management
    #webMethods
    #webMethods-Tamino-XML-Server-APIs


  • 19.  RE: TAMINOLIB.JS in ASP

    Posted Mon March 18, 2002 02:50 PM

    The “@” character followed by means "the xml record with attribute “@ino:id” = .
    Hence your difficulty - it only works when a stylesheet record with that ino:id exists.

    You stored your stylesheet with a document name (…“First.xsl”), which you can also use to retrieve your document directly.

    Let’s close.

    [This message was edited by Bill Leeney on 18 Mar 2002 at 15:10.]


    #API-Management
    #webMethods-Tamino-XML-Server-APIs
    #webMethods


  • 20.  RE: TAMINOLIB.JS in ASP

    Posted Tue March 19, 2002 09:42 AM

    The “@” character followed by means "the xml record with attribute “@ino:id” = .
    Hence your difficulty - it only works when a stylesheet record with that ino:id exists.
    You stored your stylesheet with a document name (…“First.xsl”), which you can also use to retrieve your document directly.

    Ok. Thanks for explaining. I undestand the point of solution for xsl stylesheet :cool: , but I DO NOT undestand :frowning: why the following line in my asp file using vbscript: xmlDocumentID = “/dok/@1” is NOT good! (only good is line xmlDocumentID = “/dok/@10”). :frowning: :frowning:

    Can you explain it, Bil?

    Thanks for support! :cool:

    Best Regards from POLAND
    Dariusz Baumann


    #webMethods
    #API-Management
    #webMethods-Tamino-XML-Server-APIs


  • 21.  RE: TAMINOLIB.JS in ASP

    Posted Tue March 19, 2002 10:00 AM

    Probably because there is no xml instance with ino:id=10? You can see all the ino:ids with a query like:

    http://server/tamino/database/collection/doctype?_xql=doctype/@ino:id

    Closed now. If you have further questions please post them as a new topic. Thanks.


    #webMethods-Tamino-XML-Server-APIs
    #API-Management
    #webMethods


  • 22.  RE: TAMINOLIB.JS in ASP