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
JoachimJoachim 

Dynamic Invocation Interface

Hello,

is there a way to use the Dynamic Invocation Interface rather then using the static Wsdl2Java approach? The background here is that one set of code should be able to access the production system and a test system at test.salesforce.com. Currently the Soap Service Endpoint is being compiled staticly into the Java code.
Help is appreciated!

Joachim
adamgadamg
You can set/change the service endpoint in your code, overwriting the endpoint in the WSDL; with that you should be able to dynamically switch between test and production end points.
JoachimJoachim
I thought about that, but since I'm a Java newbie - do you have example code?
Thanks for your help!

Joachim
SuperfellSuperfell
call instead of calling getSoap() on the service locator, call getSoap(new URL("https://test.salesforce.com/services/Soap/c/5.0"))
Assuming you're using the enterprise WSDL