How to handle SalesForce WSDL files for sandbox and production sites in ASP.Net?
- by Traveling Tech Guy
I need to authenticate users and get info about them from an ASP.Net application.
Since I have 2 sites (sandbox, production) and 2 org IDs - I needed to generate 2 SalesForce WSDL files.
I diffed the 2 files (each about 600kb in size) and while they are 95% the same, there are enough differences strewn all over the place - enough for me to need to use them both. I added both as web references to my solution, and here's where my problem starts.Obviously, I cannot use both references in the same file, as they contain the same classes/functions. I had to write a quick-and-dirty solution over the weekend, so I just created 2 classes - each using a different web reference - but otherwise the exact functionality, and I use the appropriate one, based on the URL the user is coming from. This works well, but strikes me as a bad (read: quick-and-dirty) solution.
My question: is there any way to do one or more of the following:
change the web reference on the fly?
use both web references in the same file, but put one in a different namespace?
find a better solution to the whole situation? I nd up with a huge XmlSerializer.dll (3mb!) - probably due to using both huge WSDL files.
Thanks for your time.