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
HarryKHarryK 

Help with Login Error in Production ORG (NA4) via the API

As of this morning, Monday Feb 19, 2007 I cannot login successfully in the production ORG (NA4) using a java application that has been in production for over 8 months.  I executed this code successfully last Friday (Feb 16, 2007).
The application works fine when I point to the sandbox account.  My case number is  01123968.
Here is the code that fails:

    public void login (String userName, String pwd, String env){
       
        try {
            service = new SforceService();
            if (env.length()> 0){
                service.setSoapEndpointAddress("https://test.salesforce.com/services/Soap/c/7.0");
            } else {
                service.setSoapEndpointAddress("https://salesforce.com/services/Soap/c/7.0");
            }
            binding = (SoapBindingStub) service.getSoap();
//            binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
        } catch (ServiceException ex1) {
            System.out.println("Service Exception logging on \n" + ex1.getMessage());
            errFlag = true;
            return;
        }
        try {
            lr = binding.login(userName, pwd);
        } catch (UnexpectedErrorFault ex2) {
            System.out.println("unexpected login error \n" + ex2.getExceptionMessage() + "\n\n");
            errFlag = true;
            return;
        } catch (LoginFault ex2) {
            System.out.println("login fault \n" + ex2.getExceptionMessage() + "\n\n");
            errFlag = true;
            return;
        } catch (RemoteException ex2) {
            System.out.println("remote Exception \n" + ex2.getMessage() + "\n\n");
            errFlag = true;
            return;
        }

The error following the login call is :
- Redirect requested but followRedirects is disabled
- Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.

The remote message is:
remote Exception
(301)Moved Permanently


I am using Simon's SforceService override for Soap message compression. Using SforceServiceLocator instead of SforceService gives the same results. Using the 8.0 URL gives the same results. If I don't set the SoapEndPoint the login works fine.
Again, the above code works fine when the SoapEndPoint is set to the sandbox.

I need the ability to run the application in the sandbox as well as the production ORG.  Any help is appreciated.

Thanks,
Harry
zakzak
What exactly is the starting URL that you use for the production org ?
zakzak
doh!, its right there in your code.

https://salesforce.com/services/Soap/c/7.0
should be
https://www.salesforce.com/services/Soap/c/7.0
HarryKHarryK
Yeah.. I saw that after I sent the message.  I'll have to find out who changed that since last Friday.

Thanks,

Harry