function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ksparkspar 

code example for vb/soap session using existing sf user login...

Hi,
We're a bunch of non-MS guys with one key old ASP web application (using IIS).
We'd like to invoke it from salesforce with the user's existing salesforce
login session.

Would somebody mind posting how that handshake takes place? My understanding
is that we need the SF_MSApi.dll for the sforce library. I think the bit we're
missing is how to do the equivalent of
binding.setHeader(new SforceServiceLocator()
.getServiceName()
.getNamespaceURI(),
"SessionHeader", sh);

//serverUrl is set from {!API_Enterprise_Server_URL_60}
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, serverUrl);


thanks, David
Ron HessRon Hess

not tested, but here are some code fragments from the VBA sforce connector ( which you can download and view), these may help, if your code will be written in VB or VBA.

Dim WithEvents sfApi As SForceSession '// this is the com object exposed by the sf_msapi.dll

Set sfApi = New SForceSession '// get a fresh object

sfApi.SetServerUrl (endpoint) '// this would be the soap endpoint

sfApi.SetSoapHeader section, name, value 

then you can do stuff like

CreateObject, Create, Query, Update passing SObject arrays

you can see the objects and methods by using the Office, Visual Basic Editor then "Object Browser" , from Excel Alt+F11 then F2

from what I can guess, you will launch your app from a salesforce custom link, with the session ID passed in, so you will need to re-compile your app to include a reference to the COM object, then your app can use the session ID to make API calls back into your salesforce data to create, update, query or just present it within the app ?

if so, it sounds doable, best of luck

 

 

ksparkspar
Excellent Ron, we'll give it a go and post our results...

BTW, it's David Young (david@kspar.net) from 400 Encinal days...
John Marco is working with me here in New Mexico as well...
hopefully I'll see you at the September conference in SF?!

Thanks again,
David