Help converting VB to FWH

Post Reply
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Help converting VB to FWH

Post by cdmmaui »

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
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Post Reply