I need to convert the following VB code to CF code. When I use cfobject or createobject inside <cfscript> I can't get a return on sResults) and I get a value for back greater then 0.  That means an error occured.

Dim oNXT As Object

Dim sRequest as String

Dim sResults as String

Dim lResult as Long

Set >
sRequest = oDoc.xml (some xml, I have this working)

sResults = ""

lResult = oNXT.ExecuteTXN("ProcessTXN", "9000", sRequest, sResults)

' Anything but 0 is an error

If lResult <> 0 Then

' Error handler

Else

' Success so load returned xml document

oDoc.loadxml sResults

End If

Here is my part of my cf code.

<!--- Only build xml and post to star for the faccilities that have records --->
<cfif GetPaymentHistory.RecordCount GT 0>
  <!--- Create XML from payment history records --->
  <cfsavecontent variable="sRequest">
  <cfoutput>
  <Root Facility="#GetPaymentHistory.FacilityDisplay#" StarVersion="#GetPaymentHistory.StarVersion#">
  <cfloop query="GetPaymentHistory">
  <Document ENRecNo="#CurrentRow#"><Column ColumnName="FacilityDisplay">#FacilityDisplay#</Column><Column ColumnName="StarVersion">#StarVersion#</Column><Column ColumnName="AccountNum">#AccountNumber#</Column><Column ColumnName="PaymentAmount">#PaymentAmmount#</Column><Column ColumnName="VeriSignReferenceNum">#VerisignAuth#</Column></Document>
  </cfloop>
  </Root>
  </cfoutput>
  </cfsavecontent>
   
  <!--- Try to connect to the Mitem application object --->
  <CFTRY>   
      <!--- If it exists, connect to it --->   
      <CFOBJECT         
          ACTION="">           CLASS="NXT_Delegate.mvConnector"         
          NAME="obj"         
          TYPE="COM">  
    <CFCATCH>   
      <!--- The object doesn't exist, so create it --->   
      <CFOBJECT         
          ACTION="">           CLASS="NXT_Delegate.mvConnector"         
          NAME="obj"         
          TYPE="COM">   
    </CFCATCH>
  </CFTRY>
  <cfset sResults = "">

  <!--- call object to post xml --->
  <cfset lResult = obj.ExecuteTXN("ProcessTXN", "9000", sRequest, sResults)>

</cfif>
</cfloop>

I get a value greater then 0 in lresult and I get an error if I try to referance obj.sResults or lResult.SResults

Thanks
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to