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
aj4aj4 

INVALID_SESSION_ID

Hi,

 

I have downloaded the partner wsdl and custom wsdl(apex webservice) from production and try to connect to test sandbox env. It gives the "INVALID_SESSION_ID" error.

 

I have downloaded the both Partner wsdl and custom wsdl form test sandbox env and was able to call webservice on same instance(test sandbox).

 

Do you need to download wsdl for test and prod envseprately  and generate java object for each instance?

 

Is there any solution to get wsdl from test sandbox and generate java object and then move the same code to connect to prod salesforce instance?

 

Please response.

 

Thanks

 

 

 

mpiercempierce
Generate your classes from the partner wsdl (well, either wsdl really) and just change the endpoint you're connecting to based on which environment you want to use. Check the sandbox and partner wsdls to get the appropriate endpoint URLs.
aj4aj4

I have two wsdls, partner and custom  . I logged in through partner wsdl and try to call custom webservice through session id. But I guess apex webservice location is from the custom wsdl  not from loginResult . Is there any way to set up the end point of webservice after login ?

 

Any sample code will appreciate.

 

 

Thanks

mpiercempierce

My jax-ws partner api tutorial (http://eng.genius.com/blog/2009/05/23/salesforcecom-partner-soap-api-jax-ws-tutorial-part-1/) covers how to change the endpoint after the login call.