• David Thomas
  • NEWBIE
  • 10 Points
  • Member since 2014
  • Technical Architect
  • Cloud Sherpas

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm after a recent working example (code) that I can prototype in VBScript and then pass onto my client, who needs to make a targeted change to a legacy VB6 app to make a real-time query against a Contact record in Salesforce.  The query is currently against a SQL DB that is not part of the legacy app, but will be migrated to salesforce.com.

The code I'm using (below), fails on when trying to parse the response (e.parse t)
--> Error during parsing, no element found at line 1
--> Code: 80044240, PocketSOAP.Envelope.11:

This article (https://developer.salesforce.com/forums/ForumsMain?id=906F00000008rMBIAY) from 2004 with replies from the PocketSOAP creator @Superfell is useful, but doesn't quite have a full example.

' PocketSOAP calling SOAP API / Partner WSDL

dim e
set e = CreateObject("PocketSOAP.Envelope.2")
' CLSID: {E2E0FB24-E58F-458f-84E0-6E09D2D51511}

e.EncodingStyle = ""
e.SetMethod "login", "urn:enterprise.soap.sforce.com"
'e.URI = "urn:enterprise.soap.sforce.com"

e.Parameters.Create "username", "sfdcuser@org.com", "urn:login"
e.Parameters.Create "password", "pwd+token", "urn:login"

' CLSID: {C7899023-E487-4268-AE2A-4EC50136DAB3}
'set mgr = CreateObject("pocketSOAP.Attachments")
'mgr.Format = formatMime

' CLSID: {D76BA06F-ABF3-4c1f-BDC9-1848D4E3CF2B}
dim t
set t = CreateObject("PocketSOAP.HTTPTransport.2")
t.SOAPAction = ""

t.Send "https://test.salesforce.com/services/Soap/u/29.0/", e.serialize

wscript.echo e.serialize

e.parse t ' <--- fails here with 'Error during parsing, no element found at line 1
' Code: 80044240, PocketSOAP.Envelope.11

wscript.echo "debug = " & e.parameters.item(0).Value

I'm after a recent working example (code) that I can prototype in VBScript and then pass onto my client, who needs to make a targeted change to a legacy VB6 app to make a real-time query against a Contact record in Salesforce.  The query is currently against a SQL DB that is not part of the legacy app, but will be migrated to salesforce.com.

The code I'm using (below), fails on when trying to parse the response (e.parse t)
--> Error during parsing, no element found at line 1
--> Code: 80044240, PocketSOAP.Envelope.11:

This article (https://developer.salesforce.com/forums/ForumsMain?id=906F00000008rMBIAY) from 2004 with replies from the PocketSOAP creator @Superfell is useful, but doesn't quite have a full example.

' PocketSOAP calling SOAP API / Partner WSDL

dim e
set e = CreateObject("PocketSOAP.Envelope.2")
' CLSID: {E2E0FB24-E58F-458f-84E0-6E09D2D51511}

e.EncodingStyle = ""
e.SetMethod "login", "urn:enterprise.soap.sforce.com"
'e.URI = "urn:enterprise.soap.sforce.com"

e.Parameters.Create "username", "sfdcuser@org.com", "urn:login"
e.Parameters.Create "password", "pwd+token", "urn:login"

' CLSID: {C7899023-E487-4268-AE2A-4EC50136DAB3}
'set mgr = CreateObject("pocketSOAP.Attachments")
'mgr.Format = formatMime

' CLSID: {D76BA06F-ABF3-4c1f-BDC9-1848D4E3CF2B}
dim t
set t = CreateObject("PocketSOAP.HTTPTransport.2")
t.SOAPAction = ""

t.Send "https://test.salesforce.com/services/Soap/u/29.0/", e.serialize

wscript.echo e.serialize

e.parse t ' <--- fails here with 'Error during parsing, no element found at line 1
' Code: 80044240, PocketSOAP.Envelope.11

wscript.echo "debug = " & e.parameters.item(0).Value