This discussion is archived
9 Replies Latest reply: Nov 20, 2012 3:30 AM by r035198x RSS

How to Make a call to Webservice from UI and Bean.

974623 Newbie
Currently Being Moderated
Hi Guys,

We are facing below issues. I will explain detail. Need some quick help.

we have jsf 1.2 version jdk 6 on weblogic box, windows env. We have a dashboard page on which the user need to select the Date as they wish and make a call to webservice from Bean. get the data and display it ,modify it and save it.

the problem is from UI how can we make direct calls to Webservice?? is there any possible solution in JSF 1.2. WE DONT HAVE ANNOTATIONS OF WS TO USE IN 1.2

when i say submit from UI the Date selected is not coming through the Bean I have. Also my developers put all business logic in a Beans constructor ,which is not prefered.

experts please help us.

thanks
Mr. Kamasani
  • 1. Re: How to Make a call to Webservice from UI and Bean.
    Kayaman Guru
    Currently Being Moderated
    971620 wrote:
    the problem is from UI how can we make direct calls to Webservice??
    Directly from the UI? What do you mean by that. Surely you don't expect the client side to call the webservice?
    is there any possible solution in JSF 1.2. WE DONT HAVE ANNOTATIONS OF WS TO USE IN 1.2
    Then don't use annotations. Annotations only make things easier, they're not required for anything.
    when i say submit from UI the Date selected is not coming through the Bean I have.
    So the backing bean isn't getting values that are being set in the UI?
    Also my developers put all business logic in a Beans constructor ,which is not prefered.
    Are you an outsourcing company?
  • 2. Re: How to Make a call to Webservice from UI and Bean.
    905019 Newbie
    Currently Being Moderated
    Why can't the date be passed to the backing bean which does the WS-call?
    Even if it could be done in JS, a WS-call from the UI sounds like a bad idea (browser specfic code, client-target server firewalls etc)
  • 3. Re: How to Make a call to Webservice from UI and Bean.
    974623 Newbie
    Currently Being Moderated
    And one more thing is ,all the business logic code is kept in a bean's Constructor method to initialise the user and date values.And unfortunately webservice code in Constructor. i know its bad idea. But we dont have much choice to make a call from UI to Webservice ( as we are getting data from Peoplesoft server). And display it on the frontend.

    Thanks Nik and Kayaman for your valuable Inputs.

    Passing date to a Bean is good idea we can try.But the question is we dont have any option or business other than making a call from UI to webservice.

    If a user selects date ,we are not getting the same date to the Bean.that is the problem.as we need to display the PS records based on any Date.

    how can we do that??
  • 4. Re: How to Make a call to Webservice from UI and Bean.
    974623 Newbie
    Currently Being Moderated
    Hello Superman,

    Any help from this forum of experts...?

    Above is my response to the problem.i am not oracle products worker.. i m newbiee

    - mr .k
  • 5. Re: How to Make a call to Webservice from UI and Bean.
    gimbal2 Guru
    Currently Being Moderated
    Any help from this forum of experts...?
    You're not getting responses, so that already answers your question.

    I really don't understand any of what you wrote. Sorry.
  • 6. Re: How to Make a call to Webservice from UI and Bean.
    905019 Newbie
    Currently Being Moderated
    If you really prefer shooting yourself in the foot, I suggest you google around for WebService JavaScript libraries. Few ideas are so crazy that nobody has done it before.
  • 7. Re: How to Make a call to Webservice from UI and Bean.
    gimbal2 Guru
    Currently Being Moderated
    Nik wrote:
    If you really prefer shooting yourself in the foot, I suggest you google around for WebService JavaScript libraries. Few ideas are so crazy that nobody has done it before.
    Pure evil. You supply the gun :)
  • 8. Re: How to Make a call to Webservice from UI and Bean.
    974623 Newbie
    Currently Being Moderated
    Hello Mr.Champion,

    It looks like, i havent heard of WS Java script Libs to implement this kind of logic with jsf / adf faces / tags

    anyways, i have to find a right gun to shoot into the foot :)

    -Mr.K
  • 9. Re: How to Make a call to Webservice from UI and Bean.
    r035198x Pro
    Currently Being Moderated
    You can call webservices from javascript using the XmlHttpRequest but there is no standard for creating it so you'll need an if-else type factory for it. Then you'll run into same origin policy problems which you could try to get around by using jsonp.
    These are the problems that people who don't use server side technologies have to deal with. You are using a server side technology (JSF) so thank your stars and invoke the webservice from a backing bean or business delegate object. If you are having problems passing some values to the server side for that call then solve that problem (it's a very simple one to solve) rather than evading it and trying a shaky workaround.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points