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

Connecting to multiple orgs from a single client using WSC and enterprise wsdl

Newbie here,


Say I have 2 different enterprise wsdl files for two different orgs how do I use WSC to generate different package names for code compiled so that I can connect, query and use sobject.xxxx from these two different orgs seperately?


I tried replacing the package name everywhere in the WSDL (changed every occurence of to but when I do that seems like the EnterpriseConnection class isn't getting created by the wsc.




Best Answer chosen by Admin (Salesforce Developers) 
Abhinav GuptaAbhinav Gupta

Did you tried using this argument " -Dpackage-prefix=myprefix", when compiling WSDL. Check this link for more details


I believe you can use different prefix value in place of myprefix above to generate different set of java packages generated for each enterprise wsdl.