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
ParamParam 

Maintaining a session for the subsequent call

Hi

i hava a login class where i am creating a login and i am getting a session id.

public class Login_SupportForce {     public SoapBindingStub sfdc = null;     private String sessionID;  private String serverURL;     public void getLogin() throws ServiceException, ApiFault, RemoteException, MalformedURLException {                     SforceService service = new SforceServiceLocator();         sfdc = (SoapBindingStub)service.getSoap();

        System.out.println("Connecting to: " + service.getSoapAddress());              try{                                   // login             LoginResult loginResult = sfdc.login("psohal@njtransit.com", "nanki"); System.out.println("Logged in");                    // Reset the SOAP endpoint to the returned server URL             sfdc = (SoapBindingStub) new SforceServiceLocator().getSoap(new java.net. URL(loginResult.getServerUrl()));         // Create a new session header object         // add the session ID returned from the login             _SessionHeader sh = new _SessionHeader();             sh.setSessionId(loginResult.getSessionId());             sessionID = loginResult.getSessionId();             serverURL = loginResult.getServerUrl();         // Set the session header for subsequent call authentication             sfdc.setHeader(service.getServiceName().getNamespaceURI(),"SessionHeader", sh); System.out.println("get Session Id " + loginResult.getSessionId());  System.out.println("get user Id " + loginResult.getUserId()); System.out.println("get user Id " + loginResult.getServerUrl());   

     }catch(Exception e ){System.out.println("error in login class " + e);}               }     }

 

now i am calling the getLogin() method of  Login_Supportforce in a servlet. i am getting a session id.

Connecting to: https://www.salesforce.com/services/Soap/c/5.0 logged in get Session Id ho3Cs8qyOVw6XmaaVxAX1XzjdG0ItJFgFQVVQMwkbydr1ssrj_4yX.J4DayBR5WPA PIwpytqduBfrSnAV.SojTteaH1xyGi1 get user Id 00530000000ekzzAAA get user Id https://na1-api.salesforce.com/services/Soap/c/5.0 error in creating case Destination URL not reset. The URL returned from login mu st be set in the SforceService

ParamParam

how ever i cant able to pull the result from any object i am getting an error i.e.

error in creating case Destination URL not reset. The URL returned from login must be set in the SforceService

thank u

 

 

 

 

 

DevAngelDevAngel

Hi Param,

You should probably set the binding object as a session variable.

dave_mwidave_mwi
I am getting this same error:

Code:
Destination URL not reset. The URL returned from login must be set in the SforceService

 when using the Force IDE and I'm suspecting that it's causing another error as well. I'm seeing the error on the command line because I have logging enabled. I think it's causing this error too:

Code:
ERROR [2008-03-11 16:36:39,024 {HH:mm:ss}] (—:additionalInitialize:–) - Unable to load trigger objects
com.salesforce.toolkit.remote.ToolkitConnectionException: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService
        at com.salesforce.toolkit.utils.ToolkitExceptionUtils.handleConnectionException(Unknown Source)
        at com.salesforce.toolkit.remote.Connection.getTypes(Unknown Source)
        at com.salesforce.toolkit.remote.registries.DescribeObjectRegistry.loadDescribeCaches(Unknown Source)
        at com.salesforce.toolkit.remote.registries.DescribeObjectRegistry.getCachedDescribeSObjects(Unknown Source)
        at com.salesforce.toolkit.ui.wizards.components.ComponentController.getTriggerObjectNames(Unknown Source)
        at com.salesforce.toolkit.ui.wizards.components.apex.ApexTriggerWizardPage.additionalInitialize(Unknown Source)
        at com.salesforce.toolkit.ui.wizards.components.BaseComponentWizardPage.initialize(Unknown Source)
        at com.salesforce.toolkit.ui.wizards.components.BaseComponentWizardPage.createControl(Unknown Source)
        at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:170)
        at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:669)
        at org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:1083)
        at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1142)
        at org.eclipse.jface.wizard.WizardDialog.access$2(WizardDialog.java:1139)
        at org.eclipse.jface.wizard.WizardDialog$4.run(WizardDialog.java:1128)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
        at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1126)
        at org.eclipse.ui.internal.dialogs.NewWizardSelectionPage.advanceToNextPageOrFinish(NewWizardSelectionPage.java:71)
        at org.eclipse.ui.internal.dialogs.NewWizardNewPage$1.doubleClick(NewWizardNewPage.java:355)
        at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:799)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.core.runtime.Platform.run(Platform.java:863)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193)
        at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:797)
        at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1384)
        at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1173)
        at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:237)
        at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:234)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:295)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3319)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
        at org.eclipse.jface.window.Window.open(Window.java:796)
        at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:182)
        at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:123)
        at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:239)
        at org.eclipse.core.commands.Command.executeWithChecks(Command.java:475)
        at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:429)
        at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:165)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:821)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:879)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:568)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:510)
        at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:126)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1423)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1100)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1125)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1110)
        at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1137)
        at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:663)
        at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2533)
        at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:679)
        at org.eclipse.swt.widgets.Tree.gtk_key_press_event(Tree.java:1845)
        at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1486)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4234)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:3973)
        at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
        at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:5593)
        at org.eclipse.swt.widgets.Display.eventProc(Display.java:1192)
        at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
        at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1487)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2969)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
        at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1169)

!ENTRY com.salesforce.toolkit 4 0 2008-03-11 16:36:39.027
!MESSAGE ERROR [16:36:39] (˜:additionalInitialize:™) - Unable to load trigger objects

 Would anyone know why this is happening? Thanks.