How to get a defined bean  in another  bean?

What should I do if I want to used a bean defined in the faces-config and I want to use it in another bean?

let suppose u have TaskManagementController define in ur facces-confi.xml then u can get this way to ur function
      FacesContext facesContext = FacesContext.getCurrentInstance();
      Application application = facesContext.getApplication();
    TaskManagementController taskManagementController = ((TaskManagementController)
        application.createValueBinding("#{TaskManagementController}").getValue(facesContext));      and now i can call any public function on that class using that easliy ....
taskManagementController.retrieveTaskTypeList();

Similar Messages

  • Creating a bean within another bean and JNDI

    Hello,
    I am trying to have one bean (a session bean) create another bean (entity
    bean). I keep getting a naming exception. Both beans are deployed in the
    same JAR file. Also, I can directly create the entity bean (from a client
    test app).
    Here is the code I have in the session bean:
    try
    Context initial = new InitialContext();
    Object objref = initial.lookup("java:comp/env/ejb/User");
    UserHome userHome =
    UserHome)PortableRemoteObject.narrow( objref, UserHome.class );
    user = userHome.create( username, password );
    catch( NamingException e )
    e.printStackTrace();
    The result is a naming exception, which is shown below. Why does the naming
    exception say "comp.env.ejb.User"?
    ***** Naming Exception *****
    javax.naming.NameNotFoundException: 'comp.env.ejb/User'; remaining name
    'ejb/Use
    r'
    at
    weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java,
    Compiled Code)
    at
    weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:133)
    at
    weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:143)
    at
    weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:143)
    at
    weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:143)
    at
    weblogic.jndi.toolkit.BasicWLContext.lookup(BasicWLContext.java:574)
    at
    weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyCo
    ntextWrapper.java:29)
    at
    weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.j
    ava:117)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at
    com.ecocap.EcoCapSystemBean.authenticate(EcoCapSystemBean.java:51)
    at
    com.ecocap.EcoCapSystemBeanEOImpl.authenticate(EcoCapSystemBeanEOImpl
    .java:146)
    at
    com.ecocap.EcoCapSystemBeanEOImpl_WLSkel.invoke(EcoCapSystemBeanEOImp
    l_WLSkel.java:120)
    at
    weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerOb
    jectAdapter.java, Compiled Code)
    at
    weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
    tHandler.java:77)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:15)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
    Code)
    Mon Mar 19 17:02:58 EST 2001:<I> <EJB JAR deployment ecocap> Exception in
    non-tr
    ansactional EJB invoke:
    java.lang.Exception: NamingException
    at
    com.ecocap.EcoCapSystemBean.authenticate(EcoCapSystemBean.java:60)
    at
    com.ecocap.EcoCapSystemBeanEOImpl.authenticate(EcoCapSystemBeanEOImpl
    .java:146)
    at
    com.ecocap.EcoCapSystemBeanEOImpl_WLSkel.invoke(EcoCapSystemBeanEOImp
    l_WLSkel.java:120)
    at
    weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerOb
    jectAdapter.java, Compiled Code)
    at
    weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
    tHandler.java:77)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:15)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
    Code)
    Mike

    thanks, but look at the new code i modified still given error on not resolving the class LoginBean in the class LoginDataBean. here is the new code.
    package webclass;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class LoginDataBean
         private Connection cn;
         private PreparedStatement addRecord;
         public LoginDataBean()throws Exception
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              cn = DriverManager.getConnection("jdbc:odbc:portal");
         public void addClient(LoginBean log)throws SQLException
              addRecord.executeUpdate("insert into clientprofile(firstname,middlename,lastname,address,occupation,organisation,gender,email,username,password)values('"+log.getFNfield()+"','"+log.getMDfield()+"','"+log.getLNfield()+"','"+log.getAdresfield()+"','"+log.getOrgfield()+"','"+log.getEmail()+"','"+log.getUsername()+"','"+(String)log.getPasword()+"'");
              addRecord.close();
              cn.close();

  • Injecting a bean in another bean in EJB3?

    Hello all,
    I am trying to inject a bean in another bean, then making a JUnit test for the parent bean. The problem is that it is displaying a nullpointerexception.
    Is the way of injection of a bean in another bean different from injecting a bean in JSF backing bean or any other client?
    I am using glassfish and EJB 3.
    Here is the code.
    JUnit Test
    @Test
        public void testReturnRequestURL() {
            List<String[]> listParameters = new ArrayList<String[]>();
            /* Assigning values for variables */
            ABean instance = new ABean();
            String result = instance.returnString(listParameters);
            System.out.println(result);
    Parent EJB
    @Stateless
    public class AccountsCheckingBean implements AccountsCheckingBeanInterface {
        @EJB
        private BBean bBean;
        public String returnString(List<String[]> listParameters) {
            String strNew = new String();
            strNew = bBean.appendXML("fileName.xml", listParameters); // *returns null here*
            return strNew;
    }What's going wrong here?

    Thanks for your reply. I am using the integrated WLS for this test.
    However, I think it might not be a previous deployment issue. I removed the dependency of ModelEJBOne on ModelEJBTwo and the application loads successfully.
    No new Session Bean was created or modified when the application failed to load. I only added a dependency that ties project ModelEJBOne to project ModelEJBTwo when it failed to load.

  • How to get the value of a session bean through a scriptlet

    Hi,
    I have defined a session bean in faces-config file and now I want to acces this bean object through a scriptlet. How should I go about doing that ?
    eg in faces-config file I have something like this
    <managed-bean>
    <managed-bean-name>pc_DepTest</managed-bean-name>
    <managed-bean-class>pagecode.WEBINF.Pages.DepTest</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    Now in another pager called xyz.jsp
    I want to access the pc_DepTest object through a scriptlet... How should I do that ?
    Thanks

    I avoid scriplets, but you could write:
    pagecode.WEBINF.Pages.DepTest test = (pagecode.WEBINF.Pages.DepTest) FacesKit.getBean("pc_DepTest");
    //you use WEBINF in package names? gack!
    ...Where in FacesKit you've defined:
    public static Object getBean(String expr){
        FacesContext context = FacesContext.getCurrentInstance();
        Application app = context.getApplication();
        ValueBinding binding = app.createValueBinding("#{" + expr + "}");
        return binding.getValue(context);
    }

  • How to get custom defined messages in WAD

    Hi
    can you please help me how to get customized error messages in WAD.
    While I'm executing in RSRT the customer exit variable throws error message saying that 'No Sales orders exist for this Sold_To Party' but when I execute same query using Bex WAD, then no error message throwing for me for given sold_to party. I tried with all options as given in below code, but WAD gives me system error that "No values found for the customer exit variable 'Zxxxx'. Please help me in this regard. Should I do any settings in WAD to get custom defined messages. Kindly let me know
    my code is as below
    I_STEP = 2.
    CASE i_vnam.
    WHEN 'Custome exit variable'.
    IF sy-subrc = 0.
    ELSE.
                   MESSAGE e060(/bmc/bw).  "No Authorization exist
                    g_errflag1 = 'X'.
                   exit.
                   CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
                      EXPORTING
                        i_class  = '/bmc/bw'
                        i_type   = c_e                                    "'E'
                        i_number = '061'
                        i_msgv2  = l_msgv2.
                         RAISE NO_REPLACEMENT.
                    l_s_range-low = g_soldto.
              l_s_range-sign = c_sign_i.
              l_s_range-opt  = c_range_opt_eq.
              APPEND l_s_range TO e_t_range.
    ENDIF.
    I_STEP = 3.
      READ TABLE i_t_var_range INTO w_s_var_range
                  WITH KEY vnam = 'customer exit variabel'.
      IF sy-subrc = 0.
    Check the flag and throw message 'No Sales orders'.
        IF g_errflag1 = 'X'.
          l_msgv1     = 'No Sales orders'.
    Call the FM to populate message
          CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
            EXPORTING
              i_class  = c_r9
              i_type   = c_e                                    "'E'
              i_number = c_000
              i_msgv1  = l_msgv1
            EXCEPTIONS
              dummy    = 0
              OTHERS   = 0.
         CALL FUNCTION 'RRMS_MESSAGES_SHOW'.
         CALL FUNCTION 'RRMS_MESSAGES_DELETE'.
          RAISE NO_REPLACEMENT..
        ENDIF.
    Thanks & Regards
    silu

    Hi
    Custom Messages WAD

  • How to use PropertyChangeSupport for a bean from another bean

    Hi all,
    I have a bean A that doesnot implements the PropertyChangeListener or have a PropertyChangeSupport as one of its member and I cant change its design. I want to fire an PropertyChangeEvent when a property is changed. I added A to PropertyChangeSupport of another bean B. The problem is that even if the Property of Bean A is changed it doesnot fire a event. Can anybody let me know how to do it?
    Thanks,
    Amit

    You need to wrap bean A inside another bean (B) that
    implements the accessor and mutator methods of Bean A
    and adds property change support in those methods
    where appropriate. You hide the actual instance of
    bean A inside an instance of bean B so no instances of
    bean A are visible to the application.This is OK, unless you don't want to change all places where A is referenced. You could subclass B from A, as long as the accessor and mutator methods are not final. Of course, instantation still has to know about B and you will have to cast to B, or use reflection, to add and remove the listeners.

  • Set value of variable in one bean from another bean

    Using JDeveloper 11.1.1.4, I thought this would be simple to do, but I haven't been able to figure out the correct syntax and am just learning java. In my view controller I have one bean set as pageflow scope, and another bean set as a request scope. How do I set the value of a variable in the first bean from the second bean? The first bean has setters and getters, but when I try to reference them in the second bean, it says it isn't allowed. The first bean looks like:
    public class ViewAmtsParameters {
        String asOfDateParam = null;
        public void setAsOfDateParam(String asOfDateParam) {
            this.asOfDateParam = asOfDateParam;
        public String getAsOfDateParam() {
            return asOfDateParam;
    }Thanks in advance,
    Troy

    for ur reference: go through entire docs.
    http://balusc.blogspot.com/2006/06/communication-in-jsf.html
    Edited by: Erp on Oct 7, 2011 9:12 PM

  • How to get iterator values from a managed bean ?

    Due to a bug in selectOneChoice i'm not able to get the label list i want to display directly from an iterator when the value binding is a managed bean.
    To solve the problem i would like to create a managed bean that contains that list and use it as the selectItems to display.
    I would like that the values in that managed bean loaded from the a data control iterator.
    My question is :
    1) is it possible to access the iterator values from a managed bean, i mean without any reference to a page definition
    2) how to do ? is it documented somewhere ? any example ?
    Thank you

    I got it also with this code:
    package view.managedBeans;
    import classification.bean.ClassificationDocument;
    import classification.castor.ClassificationLanguage;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.List;
    import java.util.Locale;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.generic.DCGenericDataControl;
    import org.exolab.castor.xml.MarshalException;
    import org.exolab.castor.xml.ValidationException;
    public class ClassificationLanguageList {
    private java.util.List<SelectItem> supportedLanguages = new ArrayList();
    public ClassificationLanguageList() throws FileNotFoundException,
    MarshalException,
    ValidationException {
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding("#{data.ClassificationDocumentDataControl}");
    DCGenericDataControl classificationDocumentDataControl = (DCGenericDataControl)vb.getValue(ctx);
    ClassificationDocument classificationDocument = (ClassificationDocument)classificationDocumentDataControl.getDataProvider();
    ClassificationLanguage[] classificationLanguage = classificationDocument.getClassification().getClassificationLanguageList().getClassificationLanguage();
    for (int counter = 1; counter < classificationLanguage.length; counter++) {
    SelectItem language = new SelectItem();
    language.setValue(classificationLanguage[counter].getClassificationLanguageCode());
    language.setLabel(classificationLanguage[counter].getClassificationLanguageLabel());
    supportedLanguages.add(language);
    public void setSupportedLanguages(java.util.List<SelectItem> supportedLanguages) {
    this.supportedLanguages = supportedLanguages;
    public java.util.List<SelectItem> getSupportedLanguages() {
    return supportedLanguages;
    }

  • How to get current db value in backing bean

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    I would like to know how could I access the old value of an attribute in backing bean.
    I know I can get it in the EntityImpl level with getPostedAttribute function,
    but as I see I don't have permission to access this function in the ViewImpl.
    I get this error:
    Error(151,33): getPostedAttribute(int) has protected access in oracle.jbo.server.EntityImpl.
    Could you help?
    What is the correct way to get the current value on db in backing bean?
    Thanks a lot!

    You can add a transient attribute to the Entity object to hold the old value of the desired attribute, then you can add this attribute to the view object.
    check [url http://www.youtube.com/watch?v=iKVIiK0FBXI]Retrieving the previous value of an ADF BC attribute 

  • How to get a int value from another class method?

    Hi,
    how can I get a value of another class method variable value.
    example,
    class elist
            int a;
         ArrayList<Event> eventArray;
         void addEvent(Event e);
         Event getEvent(int index);
         void removeEvent(int index);
         void orderEventByTime();
    interface Event
         void Command();
    class servo implements Event
         String ip;
         int time = 10;
         void Command();
    class servo_2 implements Event
         String ip;
         int time = 20;
         void Command();
    [\code]
    I want to get the time value in elist variable a; 
    and want to compare each class time?.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi,
    1) this foum provides means to format/tag code, no need to manually add -tags
    2) by default, classname start with a capital letter, method names with a lower case letter
    3) where do you want to get the time value to Elist.a? During addEvent()?
    4) what do you want to do with the time value of each event? Sum all values up to make a an overall sum?
    5) where do you want to compare the time value(s)?
    To put it in one sentence: please be more specific with your description and answer.
    Bye.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get user defined class in java client of a bpel prcoess?

    I have written a simple bpel process which returns a bean class namely employee which has three String fields(name,id and email). From java client when I am invoking the prcoess the prcoess instance is starting and completing properly. From Bpel console when I check the audit of the instance, it shows everything as expected. But in client class instead of three strings I am getting only first string i.e email in response. I checked the mapping and all WSDL files but could not find a proper reason. I am attaching the wsdls of bpel prcoess and the client code:
    BPELProcess5.wsdl
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="BPELProcess5"
    targetNamespace="http://xmlns.oracle.com/BPELProcess5"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:client="http://xmlns.oracle.com/BPELProcess5"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:sq="http://xmlns.oracle.com/BPELProcess5/bean">
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         TYPE DEFINITION - List of services participating in this BPEL process
         The default output of the BPEL designer uses strings as input and
         output to the BPEL Process. But you can define or import any XML
         Schema type and us them as part of the message types.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <types>
    <schema attributeFormDefault="qualified"
                   elementFormDefault="qualified"
                   targetNamespace="http://xmlns.oracle.com/BPELProcess5/bean"
                   xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="employeetype" >
    <all>
    <element name="fname" type="string"/>
    <element name="lname" type="string"/>
    <element name="id" type="string"/>
         </all>
    </complexType>
    </schema>
              <schema attributeFormDefault="qualified"
                   elementFormDefault="qualified"
                   targetNamespace="http://xmlns.oracle.com/BPELProcess5"
                   xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://xmlns.oracle.com/BPELProcess5/bean"/>
                   <element name="BPELProcess5ProcessRequest">
                        <complexType >
                             <sequence>
                                  <element name="input" type="string"/>
                             </sequence>
                        </complexType>
                   </element>
    <!--
                   <element name="BPELProcess5ProcessResponse">               
    <complexType >
                             <sequence>
                                  <element name="output" type="sq:employeetype"/>
                             </sequence>
                        </complexType>
                   </element>
    -->
              </schema>
         </types>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         MESSAGE TYPE DEFINITION - Definition of the message types used as
         part of the port type defintions
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <message name="BPELProcess5RequestMessage">
              <part name="payload" element="client:BPELProcess5ProcessRequest"/>
         </message>
         <message name="BPELProcess5ResponseMessage">
              <part name="payload" type="sq:employeetype"/>
         </message>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PORT TYPE DEFINITION - A port type groups a set of operations into
         a logical service unit.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <!-- portType implemented by the BPELProcess5 BPEL process -->
         <portType name="BPELProcess5">
              <operation name="process">
                   <input message="client:BPELProcess5RequestMessage" />
                   <output message="client:BPELProcess5ResponseMessage"/>
              </operation>
         </portType>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PARTNER LINK TYPE DEFINITION
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <plnk:partnerLinkType name="BPELProcess5">
              <plnk:role name="BPELProcess5Provider">
                   <plnk:portType name="client:BPELProcess5"/>
              </plnk:role>
         </plnk:partnerLinkType>
    </definitions>
    BPELPrcoess5.bpel
    // Oracle JDeveloper BPEL Designer
    // Created: Thu Jul 14 16:50:15 IST 2005
    // Author: Arka
    // Purpose: Synchronous BPEL Process
    -->
    <process name="BPELProcess5" targetNamespace="http://xmlns.oracle.com/BPELProcess5" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:ns1="http://demows/handler/SessionEJB.wsdl" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xmlns.oracle.com/BPELProcess5/bean" xmlns:client="http://xmlns.oracle.com/BPELProcess5" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"><!-- ================================================================= --><!-- PARTNERLINKS --><!-- List of services participating in this BPEL process --><!-- ================================================================= -->
    <partnerLinks><!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="client:BPELProcess5" myRole="BPELProcess5Provider"/>
    <partnerLink myRole="SessionEJBPortType_Role" name="PartnerLink_1" partnerRole="SessionEJBPortType_Role" partnerLinkType="ns1:SessionEJBPortType_PL"/>
    </partnerLinks><!-- ================================================================= --><!-- VARIABLES --><!-- List of messages and XML documents used within this BPEL process --><!-- ================================================================= -->
    <variables><!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable" messageType="client:BPELProcess5RequestMessage"/><!--
    Reference to the message that will be returned to the requester
    -->
    <variable name="outputVariable" messageType="client:BPELProcess5ResponseMessage"/>
    <variable name="Invoke_1_getEmployee_InputVariable" messageType="ns1:getEmployee1Request"/>
    <variable name="Invoke_1_getEmployee_OutputVariable" messageType="ns1:getEmployee1Response"/>
    </variables><!-- ================================================================= --><!-- ORCHESTRATION LOGIC --><!-- Set of activities coordinating the flow of messages across the --><!-- services integrated within this business process --><!-- ================================================================= -->
    <sequence name="main"><!-- Receive input from requestor.
    Note: This maps to operation defined in BPELProcess5.wsdl
    -->
    <receive name="receiveInput" partnerLink="client" portType="client:BPELProcess5" operation="process" variable="inputVariable" createInstance="yes"/><!-- Generate reply to synchronous request -->
    <assign name="Assign_1">
    <copy>
    <from variable="inputVariable" part="payload" query="/client:BPELProcess5ProcessRequest/client:input"/>
    <to variable="Invoke_1_getEmployee_InputVariable" part="empid"/>
    </copy>
    </assign>
    <invoke name="Invoke_1" partnerLink="PartnerLink_1" portType="ns1:SessionEJBPortType" operation="getEmployee" inputVariable="Invoke_1_getEmployee_InputVariable" outputVariable="Invoke_1_getEmployee_OutputVariable"/>
    <assign name="Assign_2">
    <copy>
    <from variable="Invoke_1_getEmployee_OutputVariable" part="return" query="/return/fname"/>
    <to variable="outputVariable" part="payload" query="/payload/ns2:fname"/>
    </copy>
    <copy>
    <from variable="Invoke_1_getEmployee_OutputVariable" part="return" query="/return/lname"/>
    <to variable="outputVariable" part="payload" query="/payload/ns2:lname"/>
    </copy>
    <copy>
    <from variable="Invoke_1_getEmployee_OutputVariable" part="return" query="/return/id"/>
    <to variable="outputVariable" part="payload" query="/payload/ns2:id"/>
    </copy>
    </assign>
    <reply name="replyOutput" partnerLink="client" portType="client:BPELProcess5" operation="process" variable="outputVariable"/>
    </sequence>
    </process>
    myClient.java
    package mypackage2;
    import bean.EmployeeBean;
    import java.rmi.RemoteException;
    import java.util.ArrayList;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.JAXRPCException;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.ServiceException;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.encoding.XMLType;
    import javax.xml.rpc.soap.SOAPFaultException;
    import org.apache.axis.Constants;
    import org.apache.axis.client.Call;
    public class myClient
    private static QName SERVICE_NAME;
    private static QName PORT_TYPE;
    private static QName OPERATION_NAME;
    private static String SOAP_ACTION;
    private static String STYLE;
    private static String THIS_NAMESPACE = "http://xmlns.oracle.com/BPELProcess5";
    private static String PARAMETER_NAMESPACE = "http://xmlns.oracle.com/BPELProcess5";
    private String location;
    static
    SERVICE_NAME = new QName(THIS_NAMESPACE,"BPELProcess5");
    PORT_TYPE = new QName(THIS_NAMESPACE,"BPELProcess5") ;
    OPERATION_NAME = new QName(THIS_NAMESPACE,"BPELProcess5ProcessRequest");
    SOAP_ACTION = "process";
    STYLE = "wrapped";
    public myClient()
    public void setLocation(String location)
    this.location = location;
    public void initiate(String symbol)
    try
    DeserializerImpl des = new DeserializerImpl();
    ServiceFactory serviceFactory = ServiceFactory.newInstance();
    Service service = serviceFactory.createService( SERVICE_NAME );
    Call call = (Call)service.createCall( PORT_TYPE );
    call.setTargetEndpointAddress( location );
    call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
    call.setProperty(Call.SOAPACTION_URI_PROPERTY, SOAP_ACTION);
    call.setOperationName(OPERATION_NAME);
    call.addParameter(new QName(PARAMETER_NAMESPACE,"input"), XMLType.XSD_STRING, ParameterMode.IN);
    Object[] params = new Object[1];
    params[0] = "1";
    call.setReturnType(new QName("http://xmlns.oracle.com/BPELProcess5", "BPELProcess5ProcessResponse"), EmployeeBean.class);
    EmployeeBean response = (EmployeeBean)call.invoke(params);
    System.out.println( " BPEL process initiated" );
    catch (SOAPFaultException e)
    System.err.println("Generated fault: ");
    System.out.println (" Fault Code = " + e.getFaultCode());
    System.out.println (" Fault String = " + e.getFaultString());
    catch (JAXRPCException e)
    System.err.println("JAXRPC Exception: " + e.getMessage());
    catch (ServiceException e)
    System.err.println("Service Exception: " + e.getMessage());
    catch(RemoteException e)
    System.err.println("Remote Exception: " + e.getMessage());
    public static void main(String[] args)
    String location = "http://localhost:9700/orabpel/default/BPELProcess5/1.0";
    myClient client = new myClient();
         client.setLocation( location );
    client.initiate( "" );
    }

    Hi Abdul,
    From the document, we know that CONSTRAINED flag is used to reduce the risk of injection attacks via the specified string. If a string is provided that is not directly resolvable to qualified
    or unqualified member names, the following error appears: "The restrictions imposed by the CONSTRAINED flag in the STRTOSET function were violated."
    So you need to make sure the members are passed properly to the STRTOSET function. For more details, please see the following links:
    http://ch1n2.wordpress.com/2010/02/21/the-restrictions-imposed-by-the-constrained-flag-in-the-strtoset-function-were-violated/
    http://www.bp-msbi.com/2010/04/passing-unconstrained-set-and-member-parameters-between-reports-in-reporting-services/
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to get cookie value setup by another servlet?

    Hi, Steven,
    I was trying to get a cookie value setup by another servlet. I thought it should appear under /request/cookies/ node. But it didn't.
    What I did was use the following code in a servlet to add a cookie in the server:
    Cookie c = new Cookie("ID", "123");
    res.addCookie(c);
    Is the node ID suppose to appear under /request/cookies/ node when I reload my xsql file?
    I can do this use session value. However, it is not easy to setup max age for session value. Would you please give me any suggestion about how to handle this problem? Thanks in advance.
    Julie Zhu

    Are you talking about server-side java code (servlets/jsp) or client side (applet)? Given we are in the JSP forum I'll assume we're talking server side.
    If so, you are making a common but fundamental mistake. JavaScript executes on the client, not on the server. If you want client data on the server it has to get there somehow. The simplest way to do this in JSP land is via HTTP. So... have your JavaScript code call a JSP (or servlet) and pass the value you want as a URL parameter. Of course this will also change the browser location, so if you don't want this to happen use a frame or iframe to capture your HTTP request.
    For example:
    Javascript....
    function someFunction() {
    return 1;
    var value = someFunction();
    location.href="somejsp.jsp?value=" + value;

  • How to get the IP address from baking bean?

    Hi, Im new to the JSF technology and want to find out how can i get client related info in the baking bean, like IP Address, USER_AGENT and that kind of thinks, any guide you could give me would be great, thanks in advance.
    JM

    You can use javax.faces.context.ExternalContext object to get various raw request information
    including HTTP request headers. Also, you could call request.getRemoteAddr() method indirectly
    from the object.

  • PLZ Help: how to get value of a request scoped Bean/Attribute in JSF ?!!!

    hi,
    I noticed this part of code to retrieve session scoped beans/vars in an ActionListener or other jsf classes, but it does not work for request scoped beans/vars :( what's the problem then ? what shall i do ?
    Type var = (Type)Util.getValueBinding("myBeanInRequest")).getValue(context);
    I have also set that getPhaseId() returns UPDATE_MODEL_VALUES or APPLY_REQUEST_VALUES.
    Any comment or idea ?

    I have declared my Bean in my JSP page not in the
    faces-config.xml. Does this make any problem ? Also I
    have tried the way you told me as well, but still the
    returned attribute is null.
    P.S. My bean is declared in my JSP page this way:
    <jsp:useBean id="newSurveyVar" class="SurveyModel"
    scope="request" />
    This declaration causes the SurveyModel instance to be created in request scope when the page is rendered, but that doesn't help you when the form is submitted -- that is going to happen on the next request (so the request attribute created here goes away). Basically, <jsp:useBean> is not typically going to be useful for request scope attributes (it's ok for session or application scope, though).
    and further I have this jsf code:
    <h:command_button label="Create" commandName="create"
    action="create" >
    <f:action_listener
    r type="CreateNewSurveyActionListener"/>
    </h:command_button>
    and this is my
    CreateNewSurveyActionListener.processAction(ActionEvent
    e) {
    if (actionCommand.equals("create_the_survey")) {
    FacesContext context =
    t = FacesContext.getCurrentInstance();
    SurveyModel survey =
    y =
    (SurveyModel)(Util.getValueBinding("newSurveyVar")).get
    alue(context);
    if (survey==null) // returns true :(((
    And since I've declared my beans here there is nothing
    special declared in my faces-config.xml
    For me again it is really strange why it is not
    working !!!
    Any idea ? Because the event listener is fired in a separate request, so the one you created in the page is gone.
    This is why the managed bean creation facility was created. If your component contains a valueRef that points at the bean name (or you evaluate a ValueBinding as illustrated earlier in the responses to your question), then the bean will get instantiated during the processing of the form submit.
    Craig McClanahan

  • How to get the defined printers in anothers computer withen my LAN

    happy new year for ALL
    I want to put a JAR file in the server. this JAR file enable users to print images from this server.
    the problem: I want to print the image in user's printer not in the server printer.
    so I want to get the printers defined in the user computer and print th image on his/her printer.
    waiting your reply

    There is a Java Print API. It has nothing to do with networking.
    The images must be moved from the server to the client. You didn't make it clear in what form the images exist. However that is a standard web application idiom. And it should probably be addressed as that rather than as a networking problem (since as a web application there are other parts that will probably help.)

Maybe you are looking for

  • Issue with ABAP Proxy

    Hi,     My scenario is SAP(ABAP Proxy) - XI - Web service. I can not see any messages in XI when I run the Proxy program, when I check for the outbound messages from SXMB_MONI in SAP system the message status is "Scheduled" and Q.Status shows "Messag

  • HT2534 i want to down load a app but its grey and will not let me ? why is it not letting me load it

    Why is all the music apps Grey and I cant download ????

  • Cftextarea problem

    I have a page main.cfm which contains a cflayout using tabs. One of the tabs displays a page details.cfm, which contains a cfform with a cftextarea with richtext set to yes. The submit button runs an update.cfm page, which doesn't display anything, b

  • Setting table/cell strokes to overprint

    is there a way to ad line in following script to set cell strokes in overprint? this script has been very useful to me (thanks to Jongware (http://forums.adobe.com/message/2818852#2818852)) but it's missing the overprint feature for strokes. table =

  • Multicell borders???

    I have a document with several hundred rows and I want to have a black 1pt border around 2-3 rows high x 20 columns wide. How can I do this QUICKLY? In Excel I could do one and copy and paste it. I don't have the time to manually do this 100+ times c