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
ShreeShree 

(405)Method not allowed -error in Java

Hi,

I've downloaded the enterprise.wsdl file from salesforce.com and coneverted to java clasees. I am trying to login to salesforce.com using these java  classes.My code is:

try
 {
  
     System.setProperty("http.proxyHost", "");
     System.setProperty("http.proxyPort", "80");

     SoapBindingStub sfdc = (SoapBindingStub) new SforceServiceLocator().getSoap(); 
     // login
     LoginResult loginResult = sfdc.login(request.getParameter("username"), request.getParameter("password")); 

    -----------------(rest of the code)

    ----------------------

  }catch (Exception e) {
   System.out.println("Failed in-->"+e);
   
  }

The program is compiling the first line, but it is throwing the exception in the "Login" line. The exception is "(405)Method not allowed in Java".

Can anybody help me in this? What is this error all about?

 

Thanks in advance..

ChitraChitra

Try to intialise the variables (to check if its null) outside the fun call..! Syntax seems to be fine..

Thanks,

Chitra

SuperfellSuperfell
why are you setting the proxy port, but not the proxy host ? the 405 is probably coming back from a proxy server.
ShreeShree

Hi,

I've set the proxyhost also, but missed in the code while posting.

The error now I am getting is "javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection".

What this error is about?

 

Thanks in advance.

SuperfellSuperfell
It sounds like your proxy doesn't support SSL.