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
AndykAndyk 

Connecting to salesforce from java applet.

Hello,
  Can anyone tell me how you can connect to salesforce from java applet which is invoked from scontrol ?? I downloaded the wsdl created the java stubs etc i was able to compile the code just fine, but when i run it from an applet i get class not found exception, i feel it doesn't get the path com.sforce.enterprise.fault which i am importing in the code at runtime.
 
Any ideas whether it's possible if yes i can someone point me to right direction.
 
Thanks,
Anand
AndykAndyk
All,
  As a follow-up i was able to resolve the class path issues, but i seem to have issue when i try logging into salesforce from applet.
 
When i use the following code, I get error message "Cannot Initilize CatalogManager" Any Ideas???
 
 try {
                URL wsdlLocation = this.getClass().getClassLoader().getResource("META-INF/enterprise.wsdl");
                if (wsdlLocation == null) {
                    WebServiceException e = new WebServiceException("enterprise.wsdl not found!");
                }
                port = new SforceService(wsdlLocation, new QName("urn:enterprise.soap.sforce.com", "SforceService")).getSoap();
            } catch (Exception wse) { }
   
            try {
                loginResponse = port.login(username, password);
            } catch (Exception e) {}
 
 
I am also trying to use following snippet to login but its not getting compiled, I am getting exception " unreported exception com.sforce.soap.enterprise.fault.UnexpectedErrorFault; must be caught or declared to be thrown"
 
            try {
                binding = (SoapBindingStub) new SforceServiceLocator()
                        .getSoap();
            } catch (ServiceException ex1) {
                System.out.println(ex1.getMessage());
                return;
            }
            try {
                lr = binding.login(userName, pwd);
            } catch (UnexpectedErrorFault ex2) {
                System.out.println(ex2.getExceptionMessage() + "\n\n");
                return;
            } catch (LoginFault ex2) {
                System.out.println(ex2.getExceptionMessage() + "\n\n");
                return;
            } catch (RemoteException ex2) {
                System.out.println(ex2.getMessage() + "\n\n");
                return;
            }
 
Any suggestions would be appreciated. Thanks,