Skip navigation
Currently Being Moderated

Calling an ASP from a Workflow process map

Apr 27, 2004 8:05 AM

Has anyone ever called an ASP from a process map? My code is written in BasicScript but I'm having problems with the XMLHTTP object properties and methods not being recognized. My snippet of code that isn't working is as follows:
---
Set objXML = CreateObject("Microsoft.XMLDOM")
objXML.async = False

If objXML.Load(strASPLocation) Then

Set objNodeList = objXML.getElementsByTagName("USER")

Else

msgbox "XML Load failed. Please ensure the following ASP page is valid:" & chr(13) & strASPURL

End If
---

It fails on the objXML.asyc = False line as well as on the objXML.Load line and the objXML.getElementsByTagName line. Any ideas?

Thanks.
 
Replies
  • Currently Being Moderated
    Apr 28, 2004 12:09 PM   in reply to (Perry_Edmundson)
    Perry,

    If I understand you correctly you are mearly calling an ASP page and retrieving the value returned afterwards? ( You won't be posting anything to it? )
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2004 1:09 PM   in reply to (Perry_Edmundson)
    Perry,

    Something I quickly put together. If need be you can expanded to read\parse an xmlDocument. The following code would reside within the common script container.

    NOTE: This assumes you are using MS XMLHTTP 4.0 SP2 version.

    /******************************************************************
    uses xmlHTTPGET to post to web server calling corresponding ASP
    OUT: ASP response
    ******************************************************************/
    function XMLHTTPGET() {

    try {
    // instantiate the xmlhttp object
    var objXMLHTTP = new ActiveXObject("MSXML2.ServerXMLHTTP.4.0");
    // Initializes a request and specifies the method
    objXMLHTTP.open("GET", "http://THESERVERNAME/Response.asp", false);
    // Sends an HTTP request to the server and receives a response
    objXMLHTTP.send();
    // process it
    var strResult = objXMLHTTP.responseText;

    objXMLHTTP = null;

    return strResult;

    }
    catch ( e ) {

    Agent.log("PROCESS ERROR::XMLHTTPGET() " + e.description);

    }
    }
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2004 11:32 AM   in reply to (Perry_Edmundson)
    Perry,

    I believe you would have to first replace '.responseText' with '.responseXML' ( assuming that your ASP is returning some sort of XML doc ).

    Afterwards you should be able to use the getElementsByTagName() method of the DOMDocument object. If not you can instantiate the DOMDocument obj, return the xmlDoc into it ie ( .responseXML.xml), then use the above said method to grab your Tag.

    -Else-

    If you're just after the value of the Tag and not the entire XML doc then you could save yourself the overhead and just return that.

    Just a thought.
     
    |
    Mark as:
  • Currently Being Moderated
    May 10, 2004 10:05 AM   in reply to (Perry_Edmundson)
    Perry,

    Sorry, been travelling a lot with work... Okay so, if I understand this correctly you just want the value held within a single xmldoc element.

    If I may ask... Why are you returning an entire xmldoc just to retrieve the value of a single element? Seems like a lot of overhead to me; By creating a xmldom object, loading in the xmldoc and retrieving the value of a single element.

    Why not just return the rs result thru the ASP using the Response.Write() method, then retrieve that from the ".responseText" as was previously illustrated.

    If you need to use xml then I don't see why you can't retrieve the xml document by "srvXmlHttp.responseXML.xml" and load that result into a waiting xmldomdocument, then parse the element value.

    -Jon-
     
    |
    Mark as:
  • Currently Being Moderated
    May 12, 2004 2:44 PM   in reply to (Perry_Edmundson)
    Should probably start a new forum for this as it would make it easier for others to find information. But, I don't see what you can't model it after the basic script sample, however instead you could pass in an array of usernames that will be receiving the email and loop thru each element grabbing the email address from the Users object.

    -OR-

    If it's a list that doesn't really need to be that dynamic you could just build a string of fully qualified email addresses separated by ";" then pass that directly to the Email.To property.

    -Jon-
     
    |
    Mark as:
  • Currently Being Moderated
    May 13, 2004 9:14 AM   in reply to (Perry_Edmundson)
    Yes, there is a difference between the two languages the PDF manuals explain it pretty well.
     
    |
    Mark as:
  • Currently Being Moderated
    May 14, 2004 10:06 PM   in reply to (Perry_Edmundson)
    Perry,

    In fact, if you have a look at the email samples in the documentation of WorkflowServer, you will be able to find a complete code sampel for sending emails like that. (With one exception, the sample calling statement has an error in it, suggesting you could use null value for variables that are not used (I think it was the BCC field), which will not work. Replace the null with an empty string (''), and you can use that function.)

    Cheeers,
    Sanna
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)