You need to sign in to do that
Don't have an account?
GrantM
Connection and Sandbox advice
Hi
1) Connection Advice
I want some advice on the best method to create a salesforce binding.
Both from a username and password, and from a given session.
I would also like to make a connection pool where by i have a set of sf bindings, and for each concurrent thread use one of these connections.
If i can be pointed to an article on this or given some sample code that would be great
2) Sandbox
Now that salesforce have released the sandbox, i would like to take advantage of this in my dev environment.
Now, the way i use the sandbox, is i download the WSDL from test.salesforce.com, and reference this in my project.
To make this live, i download the wsdl from www.salesforce.com and reference this in my project.
Ideally, i would like a setting in my web.config that specifies which instance we are using so i can swap much faster.
how can i achieve this?
Any help on these matters would be greatly appreciate
Regards
Grant Merwitz
1) Connection Advice
I want some advice on the best method to create a salesforce binding.
Both from a username and password, and from a given session.
I would also like to make a connection pool where by i have a set of sf bindings, and for each concurrent thread use one of these connections.
If i can be pointed to an article on this or given some sample code that would be great
2) Sandbox
Now that salesforce have released the sandbox, i would like to take advantage of this in my dev environment.
Now, the way i use the sandbox, is i download the WSDL from test.salesforce.com, and reference this in my project.
To make this live, i download the wsdl from www.salesforce.com and reference this in my project.
Ideally, i would like a setting in my web.config that specifies which instance we are using so i can swap much faster.
how can i achieve this?
Any help on these matters would be greatly appreciate
Regards
Grant Merwitz
For number 2, the key item is the endpoing url. You can definitely put this in your web config, and then read it when the app starts or whenever you need to perform a login. If you are using the enterprise wsdl, you need to make sure your test and prod schemas match exactly. Prior to the login call you can set the url of the binding object to point to test or prod.
For number 1, I must question as to why you want a connection pool? We only allow 2 or 3 concurrent connections anyway. You could create a connection "stack" with new instances of you binding objects and then pop as you need a binding and push when you are done with it. You will still have to worry about session becoming stale.
For creating a binding you simply use new SalesforceService binding = SalesforceService(). If you are creating the connection from a session id and url then you would set the session header next. binding.SessionHeaderValue = new SessionHeaderValue() and set the session id, binding.SessionHeaderValue.sessionId = sid then set the binding url, binding.url = newUrl.
If the connection is from a username and passord you just call the login method and then setup the session id and url as shown above.
If you are using .NET 2.0 you should consider the async capabilities in web services.
loginRes = binding.login("username@domainname.com","password") , it is working fine.