0

I have problem with the getter in LS2J, i can't have the result of the get in my prog !! I take some tests, this is the results :


My class in java :

public String getFonctionWS() {

    System.out.println("get : " + fonctionWS);
    return fonctionWS;
}
public void setFonctionWS(String fonctionWS) {

    System.out.println("set : " + fonctionWS);
    this.fonctionWS = fonctionWS;
}

This same class called in LS2J :

Class LogWSDTO
sessionJava As JAVASESSION      
classJava As JAVACLASS
objectJava As JAVAOBJECT        
methodJava As JAVAMETHOD


Public Sub New()
    Set sessionJava = New JAVASESSION
    Set classJava = sessionJava.GetClass("com.pasquier.DTO.WS/LogWSDTO")
    Set objectJava = classJava.CreateObject     
End Sub

Public function getFonctionWS()
    Set methodJava = classJava.GetMethod("getFonctionWS","()Ljava/lang/String;")        
    getFonctionWS = objectJava.getFonctionWS        
End function

I call this class in lotus :

 Dim session As NotesSession


    logDTO.setFonctionWS("GetAllDocuments")         
    dt = logDTO.getFonctionWS

the result print : set : GetAllDocuments

Agent 'GetAllDocuments_LogWS GADBKWS' error: Wrong number of arguments for method

Sorry if i'm not very clear ^^ I have several problems and i was difficulty to explain one by one... thanks for your help !

i begin to understand : in ls2j for get the getter, we must take a parameter ... !!!!(????)

when i try :

public String getEssai(String dt){
    System.out.println("get essai test20002");

    return fonctionWS;
}

it' fine, i have my result !! i don't understand why but it works !!

could you explain me ??

sissi49
  • 135
  • 1
  • 11
  • That is way too much code. Reduce your issue to a **short** example which throws error too. – Knut Herrmann Jun 25 '14 at 14:31
  • What is the question here? Get Set in Java. No there is no such thing! – Afzaal Ahmad Zeeshan Jun 25 '14 at 14:32
  • http://msdn.microsoft.com/en-us/library/aa287786(v=vs.71).aspx This is for C# .. I don't think there would be any thing like that, you can ***however*** create your own constants and work with them! – Afzaal Ahmad Zeeshan Jun 25 '14 at 14:32
  • i modified my explication – sissi49 Jun 25 '14 at 15:34
  • 1
    Please, create a Minimal, Complete, and Verifiable example http://stackoverflow.com/help/mcve. After your reduction it's definitely not Complete. Your example code have to be ready for copying into a test database and to show the issue you mentioned. Unfortunately, that is not the case so far. – Knut Herrmann Jun 25 '14 at 20:55

1 Answers1

1

it should be:

getFonctionWS = objectJava.getFonctionWS()
Normunds Kalnberzins
  • 1,213
  • 10
  • 20