Client-side bindings

Hi everyone
I have created a simple web service from my EmployeeRecord class.
I am using Static Stub to test it.
The add(2,3) method works  but not the getName() 
when String  getName() invoked  Null value is returned.
----------------------- my  Static Stub Client -----------------------------
public class Tester
  public static void main(String [] args) throws Exception {
    // Make a service
   EmployeeRecordServiceLocator service = new EmployeeRecordServiceLocator();
    // Now use the service to get a stub .
   EmployeeRecord  port = service.getEmployeeRecord();
    // Make the actual call
   int adding = port.add(2,3);
   System.out.println("Show adding -->" + adding );
   port.setName("reza");
   String myName = port.getName();
   System.out.println("Show my name -->" +  myName  );
------------------------ my Java class which is being used ------------------------------------
package bankStaff;
import java.io.*;
public class EmployeeRecord
private String name ;
public String getName()
return name;
public void setName(String name)
this.name = name;
public int add(int a, int b)
return a+b;
The only way that will return a value is when I modify it as the following but don't think is correct.
Because it behaves as setter & getter at the same time!!!!!!!!!!
public String setName(String name)
   return (this.name = name);
But When I use the EmployeeRecord class in  standalone application  (Non Web service) the String getName() works! It returns  String value.
EmployeeRecord class used in  standalone application
EmployeeRecord myVar = new EmployeeRecord():
myVar.setName(String name);
myVar.getName();
(Obivosualy the class EmployeeRecord has to be instantiated)
Q2 - Also How can we instantiate a class  in the Web services or do we have to?
e.g. EmployeeRecord myVar = new EmployeeRecord():  
Any clues please?
Kind regards

Does debugger help ???
Please post the soln, if u solve
L.

Similar Messages

  • Building stubs & Client-side bindings

    Hi everyone
    I have created a simple web service from my EmployeeRecord class.
    I am using Static Stub to test it.
    The add(2,3) method works  but not the getName() 
    when String  getName() invoked  Null value is returned.
    ----------------------- my  Static Stub Client -----------------------------
    public class Tester
      public static void main(String [] args) throws Exception {
        // Make a service
       EmployeeRecordServiceLocator service = new EmployeeRecordServiceLocator();
        // Now use the service to get a stub .
       EmployeeRecord  port = service.getEmployeeRecord();
        // Make the actual call
       int adding = port.add(2,3);
       System.out.println("Show adding -->" + adding );
       port.setName("reza");
       String myName = port.getName();
       System.out.println("Show my name -->" +  myName  );
    ------------------------ my Java class which is being used ------------------------------------
    package bankStaff;
    import java.io.*;
    public class EmployeeRecord
    private String name ;
    public String getName()
    return name;
    public void setName(String name)
    this.name = name;
    public int add(int a, int b)
    return a+b;
    The only way that will return a value is when I modify it as the following but don't think is correct.
    Because it behaves as setter & getter at the same time!!!!!!!!!!
    public String setName(String name)
       return (this.name = name);
    But When I use the EmployeeRecord class in  standalone application  (Non Web service) the String getName() works! It returns  String value.
    EmployeeRecord class used in  standalone application
    EmployeeRecord myVar = new EmployeeRecord():
    myVar.setName(String name);
    myVar.getName();
    (Obivosualy the class EmployeeRecord has to be instantiated)
    Q2 - Also How can we instantiate a class  in the Web services or do we have to?
    e.g. EmployeeRecord myVar = new EmployeeRecord():  
    Any clues please?
    Kind regards
    reza

    Does debugger help ???
    Please post the soln, if u solve
    L.

  • Client-side programmatically submit???

    Hi!
    I need to make SelectOneChoice to submit ONLY when user press enter key (standard autosubmit is not acceptable as it submits each time user scrolls a list with cursor keys - which 99% users do!). So I need to "catch" enter keyPress with clientListener. But I have not found any documentation on ADF RC client-side API.
    Any help appreciated!

    Hi Frank!
    You are right on this. Thank you for consideration and filling ER.
    In addition, true root of my problem is a fact that selectOneChoice is not considered Action source! The ValueChange event happens before Update Model phase, and any action bindings inoked even from ValuChange event are mostly useless (as the new value selected in list is not yet updated in bindings). I have to trick the ADFm by using auxiliary property in backing bean to indicate that value is changed and then to let ADFm executable to fire the appropriate action in Render Model phase.
    Anyhow, all this is very complicated to achieve very simple and common use-case: invoce some action binding (i.e. method in Session Bean) on autosubmit of selectOneChoice (most likely same should be available for other list components).
    Considering that most agile UIs rely on drop-down lists (and other lists) that mass data-entry users prefer to use only with keyboard navigation, this I consider major drawback in ADF RC component functionality. And I appeal on ADF team to consider implementation of this enhancement ASP.
    I would like to hear form Simon and Ric on this issue also. I stress that such "accessibility" is of great importance for certain UI uses-cases.
    Regards,
    Pavle

  • Client-side transient model for storing temporary data

    We've been using the ODataModel in our UI5 application for retrieving data from Gateway and now we have a requirement to store temporary (session based) client-side data.  Ideally it would be stored in such a way that it can be shared across views and controllers and can be bound from UI components via property bindings.  The data in most cases will be OData entities.  As an example a user would view a list of PO's (from the ODataModel) in the first view, then select a subset of POs and move onto the next view to "work" on those POs.  We'd want to store this subset of POs in a client model so the second view can bind to the model and display them.
    My first thought is to create another model separate from our ODataModel in which we could add transient client-side data (OData entities and custom data) and make it available to all views and controllers in the app.  I realize we could probably also just store such data in global JS variables, however a client-side model seems like a cleaner approach to me.
    I'd appreciate any suggestions on how this can be achieved.

    Hi Derek,
    why don't you just use sap.ui.core.Core.setModel? You can store multiple models and access them in your entire SAPUI5 app.
    Except for SAPUI5-apps, these requirements are often realized with HTML5 Web Storage JavaScript API. As you can see in the following blog post, you can easily store even complex entities and access your items in the entire web-application: Client-side Session Management.
    I can't recommend the approach with global variables. A lot of developers had negative experiences with this design pattern. At least, use namespacing techniques to store your functions and variables in one central scope. I've written a simple example on jsFiddle to show you this. As you can see, you could also handle your transient model as an additional variable of your own namespace.
    Regards Michael

  • How to generate rule log on client side

    I am looking for a solution where I could generate a rule log and make it available on client side. I know generating a log during consolidation and save it on server. However, I want to make it available on client side.
    I have created four scenarios in HFM application, namely -
    1. ACTUAL_REPORTING - To capture TB data and use it for reporting
    2. ACTUAL_ICP - To capture ICP data and run custom business rule as per requirement
    3. ACTUAL_ADDINPUT - To capture additional memorandum inputs
    During consolidation,data is copied from ACTUAL_ICP and ACTUAL_ADDINPUT to ACTUAL_REPORTING. However, problem is that user should consolidate ACTUAL_ICP AND ACTUAL_ADDINPUT scenarios first. If they miss executing the consolidation in these scenarios, then the data copied would be wrong. Just as to ensure this, there's a provision is HFM to check calculation status in rule file and looking at that, calcuation could be stopped and a message could be sent to the user. But delimma is, how to report the same on the user side.
    Possible solution that I could have thought are -
    1. To generate a rule log and post the same to the client, but how to do this? As path of the rule log could be of the server only (that is C:\Hyperion\Logs\Rule)
    2. To generate a rule log and pop a web page terminating consolidation, but how to do this?
    3. To raise an error from the rule file and direct it to the system messages, but how to to this?
    Please advice and any further clarification is required please contact me.
    Thanks & Regards,
    Mustafa

    You can define the output folder as a share, which has already been mentioned. I strongly advise against implementing any solution that in production will regularly generate an external file.
    1) The output file is generated by the DCOM user. If you want this user to generate a file in a specific location, it must be writeable by the DCOM user, and readable by the intended human user. Make sure both NTFS and share level permissions on the target file and its containing folder consider this. Latency for the file write can degrade performance.
    2) Most HFM implementations have two or more HFM application servers. You have no control over which server will execute the file, and also no control over what happens if two or more servers try to write to the same file. You can create a process which causes HFM to become single threaded if every time Sub Calculate for any entity on any server needs to open a single file. This is because the file object is single threaded. It could be multi-threaded if you write out to a database, but certainly far more complex.
    3) Wait state: while as in #2, this can single thread the process, and you have to consider whether your process will error out during moments when another process has access to the file, or if you will ignore that and simply proceed. This can have a significant impact on performance time if you decide to wait until the file becomes available.
    While I have done implementations where the overall solution required combining data across multiple scenarios, I consistently find this a cumbersome, error-prone, and poorly performing approach. For this reason, I always try to keep all of the data required in a single scenario. This is one key reason why the "DataSource" or "DataType" (or whatever you call it) approach is so popular and successful.
    Finally, you cannot write to the HFM system messages. You can, on the other hand, use Calc Manager to write out to a system log.
    --Chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Client side event for h:outputText... and other JSF component

    Hello friends...
    I need client side (to use Java script ) event for change in <h:outputText /> or <h:inputText...>.
    I want to open a popup window when there is a change in there. I donot want to use onblur() for this. Is there any thing for achiev it.
    Thanks.
    Regard
    Roshan Lal ( I don't know why there is "DOG" display in LIST )
    :-)

    Hi Jacek,
    Unfortunately I think you may be stuck extending Renderer. Another possibility is creating your component via a template, which will be available in JSF 2.0. However, as JSF 2.0 won't be out for a while... you can use JSFTemplating in the meantime:
    http://java.sun.com/developer/technicalArticles/J2EE/jsf_templating/
    http://www.theserverside.com/tt/articles/article.tss?l=JSFTemplateComponent
    Good luck!
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • How can i load file into database from client-side to server-side

    i want to upload file from client-side to server-side, i use the following code to load blob into database.
    if the file is in the server-side, it can work, but if it in the client-side, it said that the system cannot find the file. i think it only will search the file is in the server-side or not, it will not search the client-side.
    how can i solve it without upload the file to the server first, then load it into database??
    try
    ResultSet rset = null;
    PreparedStatement pstmt =
    conn.prepareStatement ("insert into docs values (? , EMPTY_BLOB())");
    pstmt.setInt (1, docId);
    pstmt.execute ();
    // Open the destination blob:
    pstmt.setInt (1, docId);
    rset = pstmt.executeQuery (
    "SELECT content FROM docs WHERE id = ? FOR UPDATE");
    BLOB dest_lob = null;
    if (rset.next()) {
    dest_lob = ((OracleResultSet)rset).getBLOB (1);
    // Declare a file handler for the input file
    File binaryFile = new File (fileName);
    FileInputStream istream = new FileInputStream (binaryFile);
    // Create an OutputStram object to write the BLOB as a stream
    OutputStream ostream = dest_lob.getBinaryOutputStream();
    // Create a tempory buffer
    byte[] buffer = new byte[1024];
    int length = 0;
    // Use the read() method to read the file to the byte
    // array buffer, then use the write() method to write it to
    // the BLOB.
    while ((length = istream.read(buffer)) != -1)
    ostream.write(buffer, 0, length);
    pstmt.close();
    // Close all streams and file handles:
    istream.close();
    ostream.flush();
    ostream.close();
    //dest_lob.close();
    // Commit the transaction:
    conn.commit();
    conn.close();
    } catch (SQLException e) {

    Hi,
    Without some more details of the configuration, its difficult to know
    what's happening here. For example, what do you mean by client side
    and server side, and where are you running the upload Java application?
    If you always run the application on the database server system, but can't
    open the file on a different machine, then it sounds like a file protection
    problem that isn't really connected with the database at all. That is to
    say, if the new FileInputStream (binaryFile) statement fails, then its not
    really a database problem, but a file protection issue. On the other hand,
    I can't explain what's happening if you run the program on the same machine
    as the document file (client machine), but you can't write the data to the
    server, assuming the JDBC connection string is set correctly to connect to
    the appropriate database server.
    If you can provide some more information, we'll try to help.
    Simon
    null

  • Print text file to  client side printer

    Hi all,
    I have a character mode report which will print to a client side dot matrix printer in 6i. After converted to 10g, we cannot print to the client side printer (because we don't want to map so many print queue from the AS).
    So, I try to generate the report to a text file, then use webutil to transfer the txt file to the client PC, and then use Client_HOST to call the window PRINT command to print the text file to the client side printer.
    I have test this is successful, however, when I try to do the same thing to a report with Vietnam character, then it is not.
    The print request is sent to the printer, but the printer have no response.
    But that file can be print successfully if I open in Notepad and then print manually.
    I try to use window TYPE command and COPY command, but still have no luck.
    Can anyone give me some suggestions for this....
    Thanks!

    Qiu (guest) wrote:
    : In the browser/applet, the default "print" button can only
    print
    : screen to local printer, not the data I want. Use Report
    server,
    : I can't directly print to client side printer. Is there a way
    to
    : print data to local printer after press a button?
    Are u using Run_Product function in the when button pressed,
    then u can specify the format in which u want the output, option
    available are HTML and PDF, report server runs the report on the
    server and sends the output to the client machine. On the client
    machine u have to open the file and print it. I cannot print the
    report itself on the client machine.
    Try.
    Sailesh
    null

  • How to Print Crystal Report without any dialog message on the client side

    Hi!
    I've read too much questions like this, but i can't find any answer.
    How can i print a report on the client side directly?
    I have three buttons, "Generate Report", "Generate PDF", "Print".
    I want when the "Print" button was clicked, automaticaly the report is printed using default printer, like PrintToPrinter function, but in the client side.
    Thanks!

    If you search for previous posts about this, you will see many posts saying not possible.  If this functionality was possible, you could essentially have a page that would send something to a clients printer just by visiting the page, how bad of security hole would that be?

  • Crystal report printing in client side

    Hi ...
    I have using asp.net web app with crystal report version 10.5.3700.0
    I have uploaded the project and database in the below link. Check out.
    http://www.2shared.com/file/vHTSGl13/ASPnet_Webapp_using_CR_Rpt_Pri.html
    http://i52.tinypic.com/2rdds7d.jpg
    I have few requirement in the crytsal report asp,net page:-
    1) If user click Print button of crystal report viewer toolbar then it goes to PDf then its show me all of my pages instead of showing me the current page on which i click print.
    2) I want to use client side print..if user click on a my print button then i need to show print dailogue like image above in that if user click print then i need to print that current page.. let us consider im viewing I3 Invoice number using Crysatl report viewer Navagition then it show me as 3/7 in toolbar if user click on my print button then i need to print the page 3 only.. coz user clicked print on Page3.
    3)My asp.net web app is in Hosting server if user click my print button then i need to show client print dailogue and it will show my cleint connected printer. Here crytsal report toolbar and other things should be hide. It should be like what we have designed in crystal report that alone should be get printed.
    4) One more thing i want is if user gives I4 invoice no. in my textbox1 then click view report button then it will show that Invoice Report now its shows two pages, here if user click print then i need to print two pages coz it has two pages...
    Please do a code using my webapp which is above and waiitng for your codes..
    Thank you
    Note: please do a code so that i can know, i already visited some of the website like http://aspalliance.com/ i didt undertstand how to do so im posting here to get a code.

    *i tried this also but it show me the same only hosting server printer not a client side printer*
    if (System.Drawing.Printing.PrinterSettings.InstalledPrinters.Count > 0)
                foreach (String myPrinter in System.Drawing.Printing.PrinterSettings.InstalledPrinters)
                    cboCurrentPrinters.Items.Add(myPrinter);
                cboCurrentPrinters.SelectedIndex = 0;
            //For printers exposed to System account as per MS Kbase
            //http://support.microsoft.com/default.aspx?scid=kb;en-us;184291
            //Look to HKEY_USERS\.Default\Software\Microsoft\Windows NT\CurrentVersion\Devices
            Microsoft.Win32.RegistryKey mySystemPrinters =
                    Microsoft.Win32.Registry.Users.OpenSubKey(@".DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\Devices");
            foreach (String defaultPrinters in mySystemPrinters.GetValueNames())
                cboDefaultPrinters.Items.Add(defaultPrinters);
            if (cboDefaultPrinters.Items.Count > 0)
                cboDefaultPrinters.SelectedIndex = 0;
    help me in this.. its very urgent needed..

  • Problem in creating client side PDF with image using flex and AlivePD

    I need a favor I am creating client side PDF with image using flex and AlivePDF for a web based application. Images have been generated on that pdf but it is creating problem for large size images as half of the image disappeared from that pdf.I am taking the image inside a canvas . How do i control my images so that they come fit on that pdf file for any image size that i take.
    Thanks in advance
    Atishay

    I am having a similar and more serious problem. It takes a
    long time to execute, but even attaching a small image balloons the
    pdf to 6MB plus. After a few images it gets up to 20MB. These are
    100k jpeg files being attached. The resulting PDF is too large to
    email or process effectively. Does anyone know how to reduce
    size/processing?

  • How to use KeyChain API from client-side HTML scripting in Safari on iPad?

    I have a requirement where I need to add client-side scripting in an HTML page to be supported by Safari on iPad that creates a private / public key pair and that creates a CSR (Certificate Signing Request) in PKCS#10 or SPKAC format that can be sent to a certification authority server using form HTTP/POST that will then return the generated certificate.
    I initially thought that I could simply use the HTML 5 tag <keygen> which can do exactly what I need, but unfortunately this tag is not at all supported on mobile Apple devices like iPad or iPhone, so I have to look for another solution.
    I have noticed that the KeyChain tool should be available on iPad using the documented API, but I have no idea based on the documentation whether the API can be called from client-side HTML scripting on iPad.
    Question : is it technically possible using the functionalities and API's exposed on an iPad to implement what I just described in HTML client-side scripting? If so, do you have some links with useful information that can help me on my way?

    I have a requirement where I need to add client-side scripting in an HTML page to be supported by Safari on iPad that creates a private / public key pair and that creates a CSR (Certificate Signing Request) in PKCS#10 or SPKAC format that can be sent to a certification authority server using form HTTP/POST that will then return the generated certificate.
    I initially thought that I could simply use the HTML 5 tag <keygen> which can do exactly what I need, but unfortunately this tag is not at all supported on mobile Apple devices like iPad or iPhone, so I have to look for another solution.
    I have noticed that the KeyChain tool should be available on iPad using the documented API, but I have no idea based on the documentation whether the API can be called from client-side HTML scripting on iPad.
    Question : is it technically possible using the functionalities and API's exposed on an iPad to implement what I just described in HTML client-side scripting? If so, do you have some links with useful information that can help me on my way?

  • Save report on client side in three tier architecture

    Hi,
    We have a 3 tier 10g R2 Application server installed on Unix.
    We want to generate and save report directly to a location on client machine.
    But when we try to do that report is saved in server and not on client machine.
    Can anyone help in this regard?
    Av.

    Hi,
    We are aware of this method, but this is causing following problems to us -
    1. Report name concurrency, we will have to change existing coding to a large extent to make sure same report when generated by different users should have seperate names so that there is no conflict.
    2. To transfer to client machine there can be access right issues, though we have not tested this aspect.
    So was thinking if there is any other way through wich we can directly save the report on client side rather than transfering file between AS and client?

  • How to copy a page( webpart page) with its content using client side.

    How to copy a page(in my case  webpart page) with its content(it may contain webparts) using client code (i mean using SPservices or ECMA script).
    What i am planning is ,to give end user a page where it will contain text box to specify  name of page and a button with the help of  content editor webpart.
    where on click of button we need to write client side code such that it should create a new page from a existing page in a library with given name by user.
    Any suggestion would be helpful. For your information we can do it through UI with the help Site Actions / Manage Content and Structure.But i want to automate it using client side code.Server side code is restricted.
    or can we create a template of an existing page with content without the help of sharepoint designer.
    Thanks in advance
    with regards Ravichandra

    This is good example
    http://balajiindia.wordpress.com/2011/05/27/using-jquery-with-custom-web-services-in-sharepoint/
    Create web service
    http://balajiindia.wordpress.com/2011/05/27/using-jquery-with-custom-web-services-in-sharepoint/. Create method "Create Page" http://www.learningsharepoint.com/2010/09/17/create-publishing-pages-sharepoint-2010-programmatically/
    Build your Java Script. You can use Content Editor Web Part if you want to avoid custom web part development http://www.codeproject.com/Articles/544538/JQuery-with-SharePoint
    Oleg

  • How To Update A Table View From Client Side !!!!

    Hi I would like to update a table view from the Client Side. So that the user can keep updating the relevent data on the client and when they have finally finished they can press Save so the entire page is then sent to the Server.
    Does anyone know how to do this, I guess u have to use the EPCM, I have just started on it and would really appreciate some Help.
    Thanks,
    Emmanuel.

    This is what I found :-
    There are a couple of ways to approach this.
    1) load the excel spreadsheet into the database "as is". You can use interMedia
    text to convert the .xls file into a .htm file (HTML) or use iFS (see
    http://technet.oracle.com/
    for
    more info on that) to parse it as well. InterMedia text will convert your XLS
    spreadsheet into a big HTML table (easy to parse out what you need at that
    point)
    2) Using OLE automation, a program you write can interact with Excel, request
    data from a spreadsheet, and insert it. Oracle Forms is capable of doing this
    for example as is other languages environments. In this fashion, you can remove
    the "manual" and "sqlldr" parts -- your program can automatically insert the
    data.
    3) You can write a VB script that uses ODBC or Oracle Objects for OLE (OO4O) in
    Excel. This VB script would be able to put selected data from the spreadsheet
    into the database. We would recommend OO4O. It provides an In-Process COM
    Automation Server that provides a set of COM Automation interfaces/objects for
    connecting to Oracle database servers, executing queries and managing the
    results. OO4O is available from
    http://technet.oracle.com

Maybe you are looking for

  • Report performance problems on htmldb 1.6

    Hello everybody, I'm not a guru in both pl-sql and htmldb and I'm having slow performances on two queries, that are similar, so I think the root of the problem is the same..here they are: This query populates a select list and takes about 2 minutes:

  • How can I create an "exit" pop up in Flex Mobile?

    Ok, I'm creating an app that has an "exit" button in all views, and when that button is clicked the only thing that I do is use "navigator.popToFirstView()", this works perfect, but I don't want people to exit right away, I want to have a pop up that

  • Attachment Upload Clasification

    Hello Guys: Currently I have a requieremnt to clasify the attachments you can upload into SRM transactions (Bid Invitations, Bids and Contracts). It is requiered to identify or load files into diferent sections. Currently when you load files all of t

  • Linking Table to view

    Pulling my hair out here - how do I link a Table to a View?

  • Fatal DW start up error

    Launching DW produces error: "XML parsing fatal error invalid document structure line 1"  DWCS4/en-US/configuration/worskspace/designer.xml" followed by "panel layout missing or can't be read"  then DW hangs.  I have CS4 student edition.  will a fres