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
magdamagda 

jar file com.sforce.soap.entreprise link

Hi,
i search the last version for the librairies:
com.sforce.soap.entreprise
com.sforce.soap.entreprise.fault
com.sforce.soap.entreprise.sobject
...

It is possible to have a link to download this one?

Thx

magda
magdamagda
Ok,

i have find this. The complet package will be created due to the entreprise.wsdl.


armenarmen
hi Magda :)
I have a problem and I  can't solve it :(
 I think (and I hope :) )  you can help me ....
so  here is the problem...
I have an apex web service and I need to call it from the java client...
package MyClass{
webService void MyWebService(){
// some code here
}

}

I've generated(by WSDL2Java) appropriate class... and now I want to call
MyWebService() function...At first I'm logging in with my salesforce account
then (when I'm calling webService) I'm getting an excaption like this :
No operation available...


Thx in advance :)

arm

magdamagda
Hi armen,

sorry but your describtion is too short.
Could you please add some src codes?

And are you using a log file?
armenarmen
hi Magda !
Thanks  for your replay..
now I'll try to expalain better ..
as I've told before  I've install the enteprise.wsdl and I've genereated the appropriate classes using WSDL2Java . Also I've genereated classes for the MyClass.wsdl....
now I want from my java clinet call MyWebService function.... but I don't know how should I do that... :(

I can login from my java client  using my salesforce account and password... here is the piece of code that I use to login.. I need to know how do I have to use the binding...
do I need for  another tools or .jars ?
Code:
private boolean login() {
        un = getUserInput("Enter user name: ");
        if (un.length() == 0) {
            return false;
        }
        pw = getUserInput("Enter password: ");
        if (pw.length() == 0) {
            return false;
        }

        System.out.println("Creating the binding to the web service...");
               try {
            binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
            System.out.println("The login url is: "+ binding._getProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY));
        } catch (ServiceException ex) {
            System.out.println("ERROR: creating binding to soap service, error was: \n"+ ex.getMessage());
            System.out.print("Hit return to continue...");
            return false;
        }

        // Time out after a minute
        binding.setTimeout(60000);
                System.out.println("LOGGING IN NOW....");
        try {
            loginResult = binding.login(un, pw);
          
           
        } catch (LoginFault lf) {
            System.out.println(lf.getExceptionMessage());
            // lf.printStackTrace();
            getUserInput("\nHit return to continue...");
            return false;
        } catch (UnexpectedErrorFault uef) {
            System.out.println(uef.getExceptionMessage());
            uef.printStackTrace();
            getUserInput("\nHit return to continue...");
            return false;
        } catch (RemoteException re) {
            System.out.println(re.getMessage());
            re.printStackTrace();
            getUserInput("\nHit return to continue...");
            return false;
        }

        System.out .println("\nThe session id is: " + loginResult.getSessionId());
        System.out.println("\nThe new server url is: "+ loginResult.getServerUrl());

        // set the session header for subsequent call authentication
        binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,
                loginResult.getServerUrl());

        // Create a new session header object and set the session id to that
        // returned by the login
        _SessionHeader sh = new _SessionHeader();
        sh.setSessionId(loginResult.getSessionId());
        binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh);
        loggedIn = true;

        
        return true;

    }

 
Thx in advance 

arm

magdamagda
Hi,

I don't realy understand your Question.

I allready call my function in my login function without problem....

login (){
MyWeServices.functiona();
}