Help converting VB to FWH

Help converting VB to FWH

Postby cdmmaui » Thu Jul 19, 2007 7:49 pm

Hello,

Can anyone help me convert the following VB code to FWH? I would appreciate the help.


Dim qbXMLRP As New QBXMLRP2Lib.RequestProcessor2

Dim ticket As String

qbXMLRP.OpenConnection cAppID, cAppName

ticket = qbXMLRP.BeginSession("", QBXMLRP2Lib.qbFileOpenDoNotCare)

Dim builder As New DOMDocument40

Dim QBXML As IXMLDOMNode
Set QBXML = builder.createElement("QBXML")
builder.appendChild QBXML
Dim msgsRq As IXMLDOMElement
Set msgsRq = QBXML.appendChild(builder.createElement("QBXMLMsgsRq"))

msgsRq.setAttribute "onError", "continueOnError"
Dim CustomerAddRq As IXMLDOMElement
Dim CustomerAdd As IXMLDOMElement
Set CustomerAddRq = msgsRq.appendChild(builder.createElement("CustomerAddRq"))

Set CustomerAdd = CustomerAddRq.appendChild(builder.createElement("CustomerAdd"))

Dim dataElement As IXMLDOMElement

Set dataElement = CustomerAdd.appendChild(builder.createElement("Name"))
dataElement.appendChild builder.createTextNode(custName)

Dim supportedVersion As String

supportedVersion = qbXMLLatestVersion(qbXMLRP, ticket)

requestXML = qbXMLAddProlog(supportedVersion, builder.xml)

responseXML = qbXMLRP.ProcessRequest(ticket, requestXML)


qbXMLRP.EndSession ticket

qbXMLRP.CloseConnection
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Postby Antonio Linares » Tue Jul 24, 2007 5:58 pm

qbXMLRP = CreateObject( "QBXMLRP2Lib.RequestProcessor2" )

qbXMLRP:OpenConnection( cAppID, cAppName )

ticket = qbXMLRP:BeginSession( "", CreateObject( "QBXMLRP2Lib.qbFileOpenDoNotCare" ) ) // Not sure about this. Maybe QBXMLRP2Lib.qbFileOpenDoNotCare its a constant value

builder = CreateObject( "DOMDocument40" )
QBXML = builder:createElement( "QBXML" )
builder:appendChild( QBXML )
msgsRq = QBXM:.appendChild( builder:CreateElement("QBXMLMsgsRq"))

msgsRq:setAttribute( "onError", "continueOnError" )
CustomerAddRq = msgsRq:appendChild(builder:createElement("CustomerAddRq"))

CustomerAdd = CustomerAddRq:appendChild(builder:createElement("CustomerAdd"))

dataElement = CustomerAdd:appendChild(builder:createElement("Name"))
dataElement:appendChild( builder:createTextNode(custName) )

supportedVersion = qbXMLLatestVersion(qbXMLRP, ticket)

requestXML = qbXMLAddProlog(supportedVersion, builder:xml)

responseXML = qbXMLRP:ProcessRequest(ticket, requestXML)


qbXMLRP:EndSession( ticket )

qbXMLRP:CloseConnection()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 35 guests