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
Help converting VB to FWH
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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()
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()