How to read parameter in WebService

hello, i am new to webservices and i want to pass a parameter to my webservice.
i declared a parameter "myname" in my wsdd file:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
  <service name="TestService" provider="java:RPC">
    <parameter name="className" value="testService.TestService"/>
    <parameter name="allowedMethods" value="*"/>
    <parameter name="myname" value="myvalue"/>
  </service>
</deployment>how can i read this parameter in my webservice classes?

Hi,
Here is an incomplete answer for our problem that works for me, but is unfortunately not enough because it is not specific to one webservice but to the whole axis server...
This is certainly not the official way to do it (don't even know if there is any one) but hey...
Okay, you have first to open the web.xml file under the following directory on my computer, I let you find yours ;)
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\web.xml
BEFORE any <servlet> tag, add this:
<context-param>
   <param-name>myParamName</param-name>
   <param-value>myParamValue</param-value>
</context-param>then in the java code, in the init function of the ServiceLifeCycle, use the context Object passed as parameter like this:
import javax.servlet.ServletContext;
import javax.xml.rpc.server.ServletEndpointContext;
public void init(Object context){
ServletContext sc = ((ServletEndpointContext)context).getServletContext();
String myParamValue = sc.getInitParameter("myParamName");
}There you go (works for me)!
As I said, I really hope It is possible to specify such a parameter Value for a given webservice because currently this is a very global declaration and it is not easy to modify it. The best way of doing it would be to put the thing in the wsdd file!
Hope that help!
Don't hesitate to post anything new if you find something, that would help me too!

Similar Messages

  • How to read response from WebService call

    Hi,
    I am consuming webservices in ABAP. I got proxy classes created. Port is also created.
    I am calling classes generated by proxy in ABAP. Classes creates few structure by system. when i make a call to service, I am not getting importing values in veariables declared. Trace file (in SOAMANAGER ) shows call successful & XML file shows the correct response values, but are not appearing in program variables. I declared variables of same type generated by system.
    My question is, am I missing any step.configuration? or how to read the variables?
    Thanks in advance.
    Sunil

    You coud create a procedure like this:
    CREATE OR REPLACE PROCEDURE soap_env_pr (p_soap_env IN VARCHAR2)
    IS
       v_start     NUMBER;
       v_end       NUMBER;
       v_message   VARCHAR2 (400);
       v_length    NUMBER;
    BEGIN
       v_start := INSTR (p_soap_env, '<ns0:Ok>');
       v_length := LENGTH ('<ns0:Ok>');
       v_end := INSTR (p_soap_env, '</ns0:Ok>');
       v_message :=
              SUBSTR (p_soap_env, v_start + v_length, v_end - v_start - v_length);
       HTP.prn ('Ok: ' || v_message);
       v_start := INSTR (p_soap_env, '<ns0:SessionNumber>');
       v_length := LENGTH ('<ns0:SessionNumber>');
       v_end := INSTR (p_soap_env, '</ns0:SessionNumber>');
       v_message :=
              SUBSTR (p_soap_env, v_start + v_length, v_end - v_start - v_length);
       HTP.prn ('SessionNumber: ' || v_message);
       v_start := INSTR (p_soap_env, '<ns0:ErrorMessage>');
       v_length := LENGTH ('v_length');
       v_end := INSTR (p_soap_env, '</ns0:ErrorMessage/>');
       v_message :=
              SUBSTR (p_soap_env, v_start + v_length, v_end - v_start - v_length);
       HTP.prn ('ErrorMessage: ' || v_message);
    END;and call it like this:
    BEGIN
       soap_env_pr
          ('<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/>
    <env:Body>
    * <invokeScenarioResponse xmlns:ns0="xmlns.oracle.com/odi/OdiInvoke/" xmlns="xmlns.oracle.com/odi/OdiInvoke/">*
    * <ns0:Ok>true</ns0:Ok>*
    * <ns0:SessionNumber>2223201</ns0:SessionNumber>*
    * <ns0:ErrorMessage/>*
    * </invokeScenarioResponse>*
    </env:Body>
    </env:Envelope>'
    END;That would give you this output:
    Ok: true
    SessionNumber: 2223201
    ErrorMessage:Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • HTTP Sender - how to read URL Parameter USER id into Mapping

    Hi,
    My scenario is HTTP - XI - ABAP Proxy.
    I wanted to capture USER id of the person who posted(HTTP) into XI(Mapping). How to read/evaluate the value of sap-user from querystring of URL ?
    http://HOST:8008/sap/xi/adapter_plain?namespace=http%3A//abc.com/sales_oa&interface=MI_sales_OA&service=DEV_D&party=&agency=&scheme=&QOS=EO&<b>sap-user=SM9999</b>&sap-password=xxxxx&sap-client=001&sap-language=EN
    please help.

    Mallik,
    Try  URL Parameters in HTTP sender communication channel.
    In the sender communication channel set Adapter Specific Message Attributes. Click on Apply URL Parameters. In Parameter1 put sap-user (U can query any URL parameter by giving its name as in the HTTP URL).
    Now in SXMB_MONI, in inbound payload SOAP Header, under Dynamic configuration u can see the value of the user. Query the same in Mapping using Dynamic Configuration using keyName as UrlParamOne.
    Regards,
    Sudharshan N A
    Message was edited by:
            Sudharshan Aravamudan

  • How to pass parameter into a source variable of a invoke activity

    I'm an new BPELer, I created a invoke activity to submit Oracle Appplications concurrent program, but I don't know how to pass parameter into source variable.
    BTW, I have created the mapper file (.xsl) file.
    could anyone tell me how to do that?
    Thanks,
    Victor

    Hi.
    How you start application? I think you send message to webservice(BPEL process is webservice too). So construct message with variable and value.
    But I created only processes where input value doesn't matter. I haven't use mapper yet too.

  • How to read the current selection in a table.

    Hello Experts,
    I've this issue with the web dynpro. I have a Adaptive Webservice Model in web dynpro. And I have three tables in the UI. When a row is selected in the first table, the second table is populated with the appropriate data (using a method in the web service.) the same applies to the third table, when the a row is selected in the second table, the third table has to be populated with the appropriate data. The methods in the web service are all working fine. However, in web dynpro, I am not able to figure out on how I read the selected row in a table. Any information on how to resolve this would be really really helpful.
    <
    wdContext.currentGetMailElement().setProfileID("-Should be read from the selected row in the table.");
    wdThis.wdGetMailControllerController().executeGetMail();
    >
    regards,
    Sam.

    Hi Samuel,
    I didnt clearly understood  your problem. When you are selecting a particular row in a table you are executing a web service named Get Mail. Are you passing any input parameter(any selected row data)  while executing a web service. And when you get the response node where you have a attribute in the node getmail. Am I right.
    If this is the case, then first check if the GetMail node is present or not by comparing it will null or checking its size. If the node is null then you will not get attribute as the element itself is null as nothing is retrieved in response. And if the node is not null then the element at 0th position is selected by default. you can retreieve the attribute by directly using the following code
    if(wdContext.nodeGetMail() !=null)
        String profileId= wdContext.currentGetMailElement().getProfileID();
    Check if this works for you.
    Regards,
    Ardhendu Sarkar

  • How to extract data via webservices and configure webservices in BI 7

    Hi to all,
    Can any body tell me How to extract data via webservices and configure webservices in BI 7.
    i have created a remote functionmodule which extract data from R/3 , now i want to upload data to BI 7 using that remote function module.
    i have use webservice (push) as adapter mode, as i want to connect function module with SOAP , via web services.
    please can any body tell how to do that.
    also how to configure the webserive , what is it .
    I SHALL BE THANKFULL TO YOU FOR THAT
    Regards
    Pavneet rana

    Hi,
    1. Using the function library (transaction SE37), call the Web service creation wizard.
    To do this, select the desired function module in the function library and choose Utilities ®Generate Web Service ® From the Function Module.
    2. Go through the following steps, shown in the wizard:
    a. Create a virtual interface.
    The virtual interface represents the interface between the Web Service and the outside.
    b. Choose the end point.
    The name of the function module that is to be offered as Web service is already entered here.
    c. Create the Web service definition.
    The Web service definition helps with assigning the Web service features, such as how security can be guaranteed in data transfer.
    d. Release the Web service.
    The wizard generates the object virtual interface and Web service definition in the object navigator.
    The function group that was generated when the XML DataSource was created is not transportable and is thus assigned to a local package. To prevent errors due to transports, make sure that the objects that were generated in the Web service creation wizard are assigned to a local non-transportable package.
    The Web service is released for the SOAP runtime.
    3. In the virtual interface for the import parameter DATASOURCE, define the name of the XML DataSource as the fixed value.
    A separate function group is generated for each XML DataSource. It makes sense to pre-assign the parameter DATASOURCE with the name of the XML DataSource in the virtual interface of the Web service for which the function group was generated.
    If you do not pre-assign the parameter, it will be necessary to transfer the data sent with the appropriate filled DataSource element, for example, by setting the value in the application that implements the Web service.
    a. In the object navigator, choose the name of the package in which the Web service was created and choose Enterprise Services ® Web Service Library ® Virtual Interfaces.
    b. Choose Change in the context menu for the virtual interface.
    c. For the virtual interface, remove the flags exposed and initial and enter the name of the XML DataSource in apostrophes, for example u20196ADATASOURCENAMEu2019.
    d. Activate the virtual interface.
    Regards,
    Marasa.

  • How to get parameter value from report in event of value-request?

    Hi everyone,
    The customer want to use particular F4 help on report, but some input value before press enter key are not used in event of "at selection-screen on value-request for xxx", How to get parameter value in this event?
    many thanks!
    Jack

    You probably want to look at function module DYNP_VALUES_READ to allow you to read the values of the other screen fields during the F4 event... below is a simple demo of this - when you press F4 the value from the p_field is read and returned in the p_desc field.
    Jonathan
    report zlocal_jc_sdn_f4_value_read.
    parameters:
      p_field(10)           type c obligatory,  "field with F4
      p_desc(40)            type c lower case.
    at selection-screen output.
      perform lock_p_desc_field.
    at selection-screen on value-request for p_field.
      perform f4_field.
    *&      Form  f4_field
    form f4_field.
    *" Quick demo custom pick list...
      data:
        l_desc             like p_desc,
        l_dyname           like d020s-prog,
        l_dynumb           like d020s-dnum,
        ls_dynpfields      like dynpread,
        lt_dynpfields      like dynpread occurs 10.
      l_dynumb = sy-dynnr.
      l_dyname = sy-repid.
    *" Read screen value of P_FIELD
      ls_dynpfields-fieldname  = 'P_FIELD'.
      append ls_dynpfields to lt_dynpfields.
      call function 'DYNP_VALUES_READ'
        exporting
          dyname     = l_dyname
          dynumb     = l_dynumb
        tables
          dynpfields = lt_dynpfields
        exceptions
          others     = 1.
      check sy-subrc is initial.
    *" See what user typed in P_FIELD:
      read table lt_dynpfields into ls_dynpfields
        with key fieldname = 'P_FIELD'.
    *" normally you would then build your own search list
    *" based on value of P_FIELD and call F4IF_INT_TABLE_VALUE_REQUEST
    *" but this is just a demo of writing back to the screen...
    *" so just put the value from p_field into P_DESC plus some text...
      concatenate 'This is a description for' ls_dynpfields-fieldvalue
        into l_desc separated by space.
    *" Pop a variable value back into screen
      clear: ls_dynpfields.
      ls_dynpfields-fieldname  = 'P_DESC'.
      ls_dynpfields-fieldvalue = l_desc.
      append ls_dynpfields to lt_dynpfields.
      call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname     = l_dyname
          dynumb     = l_dynumb
        tables
          dynpfields = lt_dynpfields
        exceptions
          others     = 0.
    endform.                                                    "f4_field
    *&      Form  lock_p_desc_field
    form lock_p_desc_field.
    *" Make P_DESC into a display field
      loop at screen.
        if screen-name = 'P_DESC'.
          screen-input = '0'.
          modify screen.
          exit.
        endif.
      endloop.
    endform.                    "lock_p_desc_field

  • How to read an XML from a servlet?

    Hi,
    I'm just starting programming and now I have a problem I can't solve. I hope someone can help me.</p>
    On the client side I have a xml report and a script wich sends to the server the information I've got from the report. In this case, the 'Poliza' value.
    On the server-side I have a servlet. I try to get the parameters (from the URL or from the XML), but I don't have any response on the client side. I'm sure I'm doing something wrong but I can't find the solution for solving it.
    I suppose there are two ways of solving the problem.
    - Make an http connetion and send just the parametes on the URL? Does anyone know how to make it?
    - Reading the XML on the servlet and extract the parameters the script sent. Does anyone know how to read it?
    Thank you in advance
    I attach part of the code.
    CLIENT SIDE
    <report....>
    <field sortid="0" id="Poliza" inputtype="textbox" label="Poliza" rows="1" wide="false" required="false"/>
    </report>
    <script name="ValidacionOnlineValidation1" script="if (0 == 0){
    var szURL="http://URLServer/vonline/vonline?Poliza="+Poliza.value;
    var szUserAgent = "JoP-XML_Posting_v1.0";
    var m_XML;
    /* In the line below, construct a XML-document that contains all the information you need to send to the server*/
    var szXML = "<?xml version=\"1.0\"?><data><objects><object name=\"Poliza\" value=\"123456789\"/></objects></data>";
    /* Create an instance of the MS XML Document Object Model Parser*/
    m_XML= new ActiveXObject("Microsoft.XMLDOM");
    m_XML.validateOnParse=true;                                                                                                         
    var bLoadResult = m_XML.loadXML(szXML);
    if (bLoadResult==true) {
      /*Instance of the transport object, method,...*/
      var m_HttpReq = new ActiveXObject("Pocket.HTTP");
      m_HttpReq.method = "GET";
      m_HttpReq.Headers.create("Content-Type", "text/xml");
      m_HttpReq.Headers.find ("User-Agent").Value = szUserAgent;
      m_HttpReq.timeout = 150000;
      /*Do the actual post of the data*/
      var m_HttpResponse = m_HttpReq.GetResponse(szURL,m_XML.xml);
      if (m_HttpResponse.statusCode==200) {...}
    SERVER SIDE
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
         String Error="";
         String MSG = "";
         response.setContentType("text/html");
         PrintWriter out1 = response.getWriter();
         Enumeration arrayparametros = request.getParameterNames();
         for (;arrayparametros.hasMoreElements();){
              String parametro = (String)arrayparametros.nextElement();
              String valorparametro = request.getParameter(parametro);
              if (parametro.equals("Poliza")){
                   vonlineLogica logica = new vonlineLogica();
                   LOGS ="on";
                   Respuesta respuesta = logica.procesarSolicitud(request,valorparametro);
                   Error = Respuesta.getError();
                   MSG = Respuesta.getMensaje();
              else{          
                   Error = parametro; MSG = valorparametro;
                   String[] values = request.getParameterValues(parametro);
         out1.println("Result: " + Error + " / " + MSG);
         out1.close();                    
    }

    Thanks by your help Shanu.
    Nevertheless, finally I tryed the easiest way (pass the parameter with 'GET'). Moreover I found why my code wasn't working. It was a fool thing. I though PDA connect throught a proxy, but it wasn't true. Whatever.
    Regards.
    FSG.
    The final script on the xml-report is:
    <report type="Validacion Online" required="false" multiple="false" attachments="false" scriptref="store://this/reportdef/script[@name='ValidacionOnlineValidation1']">
         <field sortid="0" id="Poliza" inputtype="textbox" label="Poliza" rows="1" wide="false" required="false"/>
    </report>
    <script name="ValidacionOnlineValidation1" script="if (0 == 0)
    var szURL="http://URL/vonline/vonline?parameter1=";+Poliza.value;                         
    var m_HttpReq = new ActiveXObject("Pocket.HTTP");                                             m_HttpReq.timeout = 15000;
    var m_HttpResponse = m_HttpReq.GetResponse(szURL,"");
    window.alert(m_HttpResponse.string);
    if (m_HttpResponse.statusCode==200)  {....}
    else {....}

  • How to read RRI sent parameters in ABAP Report??(Urgent)

    I have my own ABAP report. How can I read parameter that RRI sent to me from BEX Query? I know it's possibly needed to setup table name in RSBBS for each element.

    hi,
    i am failing to see relevance of this post in WebDynpro for ABAP forum.  Requesting moderator to move to ABAP general forum.

  • How to read XKOMV-EDATU, XKOMV-KBETR fields inside java

    How do get the 
    XKOMV-EDATU date and pass it to ItemUserExit.java for database read and filtering.
    a. The code in ItemUserExit has to filter ZCPI2-ZSPMON for this date XKOMV-EDATU, the delivery date.
    This does not work. prItem.getPricingTimestamp returns the current date always, NOT delivery date.
    What is the method call that will grab this date.?
    b. How do I have to pass this XKOMV-EDATU date to ItemUserExit.java for database read / filtering.
    c. The field XKOMV-KBETR has to be read based on the KSCHL = ‘ZCP1’ and / or KSCHL =’PR00’.
    These are abap structures. But I am not sure how to read this value inside java.
    How would I extract the structure XKOMV-KBETR(the rate) for KBETR(conditionType)=’PR00’ .
    Please note that I get an error mandatory condition PR00 is missing. (see attached error message ).
    d. “CPIW_A” set up in ItemUserExit.java :: itemUserExitAccess.addItemAttributeBinding("CPIW_A", ZVALUE_CPIW_A );
    is NOT available at PricingUserExits.java with the code:
    prItem.getItemAttributeBinding("CPIW_A") ,
    though they are registered in the method
    “determineRelevantAttributesForValueFormula” as per the help html pages.
    I had attached the code.
    Can you scan thru the code and give feedback.
    Can I call you in the morning.
    Thanks.
    TK
    PS:
    I get an error “PR00” mandatory condition is missing from the log file.
    ======
    OP="ChangeDocument" ID="34800003" STATUS="200" />objectIds[1]=07F9101FD1D0AD4686B2411E3EFB2DF1&messageTypes[1]=E&messages[1]=Pricing error: Mandatory condition PR00 is missing&areas[1]=SPE&numbers[1]=801&args1[1]=PR00&args2[1]=&args3[1]=&args4[1]=Nov 11, 2005 12:41:37... ...p.sxe.socket.server.rfc.RFCConnection JCO.ServerThread-3 Info: response time of command C
    However, I get the response header as:
    availableItemConditionTypeNames[1]=PR00&availableItemConditionTypeNames[2]=VA00&availableItemConditionTypeNames[3]=ZA00&availableItemConditionTypeNames[4]=ZOUT&availableItemConditionTypeNames[5]=ZCRT&availableItemConditionTypeNames[6]=K004&availableItemConditionTypeNames[7]=RA01&availableItemConditionTypeNames[8]=RB00&availableItemConditionTypeNames[9]=ZB00&availableH
    CODE:
    ItemUserExit.java snippet:
              qrypair2[0]  = new sys_query_pair("ZCPI", <b>"200501"</b>, sys_query_pair.GREATER); //
              projection = new String[] { "ZCPI" } ;
              sorting = new String[] { "ZCPI" } ;           res resultSet = database.db_read_first_row("ZCPI2", qrypair2, projection, sorting);
    I need to pass the XKOMV-EDATU date field in the above bolded date field.  I think this field is available thru the API for IPricingItemUserExit  inside the overwriteConditionValue method's parameter .
    METHOD
    overwriteConditionValue:
         public BigDecimal overwriteConditionValue(IPricingItemUserExit      prItem,
                                                             ILastPrice                lastPrice,
                                                             IPricingConditionUserExit prCondition,
                                                             int                       valueFormNo) {
              String sold2party = "", strCPIW_A = "", strCPIW_B = "";
              BigDecimal condValue = prCondition.getConditionValue().getValue();
              BigDecimal netValue  = prItem.getNetValue().getValue();
              String prod = (prItem.getProduct()!=null)? prItem.getProduct().toString(): "NULL";
              SAPTimestamp  priceTstamp = prCondition.getConditionFindingTimestamp(); //prItem.getDefaultConditionAccessTimestamp();  //getPricingTimestamp();
              String strTstamp = priceTstamp.formatYYYYMMDD();
              //KOMP-EDATU ??
              logInfo("valueFormNo: " + valueFormNo +  " Condition Table type:"  + prCondition.getConditionTypeName() +
                         ", condVal:" + condValue + ", netValue:" + netValue + ", KOMP-EDATU:" + strTstamp );
              switch (valueFormNo) {
                   case 601:
                             try{
                               sold2party = prItem.getHeaderAttributeBinding("SOLD_TO_PARTY").getValue().getValue();
                               IAttributeBinding iamCPIW_B  = prItem.getItemAttributeBinding("CPIW_B");
                               IAttributeBinding iamCPIW_A  = prItem.getItemAttributeBinding("CPIW_A");
                               if( iamCPIW_A !=null) strCPIW_A = iamCPIW_A.getValue().getValue();
                               if( iamCPIW_B !=null) strCPIW_B = iamCPIW_B.getValue().getValue();
                             }catch(Exception e) {
                                  logInfo("EXCEPTION @ GetAttributeBinding exception : " + e.getMessage());
                             logInfo("sold2party: " + sold2party + " strCPIW_A, strCPIW_B: " + strCPIW_A + ", " + strCPIW_B);
                             String CPIW_A = null, CPIW_B = null, BASE_PRICE = null;
                             logInfo("overwriteConditionValue " +
                                   "_CPIW_A: " + _CPIW_A + ", _CPIW_B: " + _CPIW_B + ", _BASE_PRICE: " + _BASE_PRICE );
                             double l_cpiw_a, l_cpiw_b, l_base;
                             if( _CPIW_A == null || _CPIW_B == null || _BASE_PRICE == null) {
                                  logInfo("overwriteConditionValue *tk* static _CPIW_A.... NULL. returning 999999L" );
                                  return BigDecimal.valueOf( 0L );
                             }else{
                                  l_cpiw_a = Double.valueOf(_CPIW_A).doubleValue();
                                  l_cpiw_b = Double.valueOf(_CPIW_B).doubleValue();
                                  l_base   = Double.valueOf(_BASE_PRICE).doubleValue();
                                  logInfo("overwriteConditionValue *tk* ???? using STATIC Class Variables" );
                             logInfo("overwriteConditionValue " +
                                   "cpiw_a: " + l_cpiw_a + ", l_cpiw_b: " + l_cpiw_b + ", l_base: " + l_base );
                             double fraction = (l_cpiw_a - l_cpiw_b)/l_cpiw_b;
                             logInfo("overwriteConditionValue " +
                                       "*tk* double fraction: " + fraction );                                               
                             double result = l_base * fraction;
                             logInfo("overwriteConditionValue " +
                                       "*tk* double calculated Result: " + result );                       
                             BigDecimal retValue = BigDecimal.valueOf (Math.round(result));
                             condValue = retValue;
                             try{
                                  prCondition.setConditionRate(retValue , "USD");     
                             }catch(Exception convEx){
                                  logInfo("overwriteConditionValue " +
                                                           "*tk* converstion Rate Exception " + retValue );
                             prItem.setObjectForUserExits("XKOMV_KBETR_C", retValue);
                             logInfo("overwriteConditionValue: 601 conditionRate Return Value: " + retValue );
                             return retValue;
                   case 602:
                             /* Forecasted CPI-W value = ( ( D * ( ( A – B ) / B ) )  – ( D + C ) ) */
                        double A = Double.valueOf( PricingUserExits.ZCPI2_ZCPI ).doubleValue();
                        double B = Double.valueOf( PricingUserExits._CPIW_B ).doubleValue();
                        double C=0, D=0;
                        BigDecimal bdC = (BigDecimal)prItem.getObjectForUserExits("XKOMV_KBETR_C");
                        C = bdC.doubleValue();
                        D = C * 0.8;  // just for calculation verification.
                        // C = Double.valueOf( PricingUserExits.XKMOV_KBETR_C ).doubleValue();
                        // D = Double.valueOf( PricingUserExits.XKMOV_KBETR_D ).doubleValue();
                        logInfo("overwriteConditionValue " +
                                                           "*tk* A, B, C, D: " + A + ", " + B + ", " + C + ", " + D);
                        double res1 =  A - B ;
                               res1 =  res1 /B ;
                               res1 =  D * res1;
                        double res2 =  D + C ;
                        double CPI_W ;
                               CPI_W = res1 - res2; //– res2;
                        BigDecimal retn =  new BigDecimal(CPI_W) ;
                       logInfo("overwriteConditionValue *tk* case 602 returning - " + retn );
                        return retn; // new BigDecimal(99999L);
                   default:
                        throw new FormulaNotImplementedException(prItem, "value formula", valueFormNo);

    Java != javascript.
    You can not call java directly from javascript.
    The lifecycle:
    Request received
    Java/JSP runs produces an HTML page
    Java stops running
    Javascript runs on page when page is loaded.
    The only way to call java code again is to submit a request and get the result back in a response. Traditionally the response is a new JSP page to replace the old one.
    Using AJAX the response can be just information that you then alter the current page with.
    The first example given by skp71 will probably NOT be what you are after. The java code is executed when you load the page, NOT when you push the button which is most probably what you are after.
    AJAX is a solution, as is loading a new page.
    Cheers,
    evnafets

  • How to pass parameter as http POST in pageContext.setForwardURL

    Hi,
    I need to call a third party application page in my custom OAF page. I need to pass parameter to this third party page using POST method. I am using following command to call that -
    HashMap hm = new HashMap();
    hm.put("FirstName",firstName );
    hm.put("LastName",lastName);
    hm.put("AppSignature", signature);
    pageContext.setForwardURL(hopURL,
    null, // not necessary with KEEP_MENU_CONTEXT
    OAWebBeanConstants.KEEP_MENU_CONTEXT, // no change to menu context
    null, // No need to specify since we're keeping menu context
    hm, // request parameters
    false, // retain the root application module
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES, // display breadcrumbs
    OAException.ERROR);
    I am passing parameter to the page using hash map table. That application is expecting the parameters in POST format and I believe using hash map table the parameters will be passed as GET format.
    We figured that out because one of the parameter we have to send is AppSignature which is 160 characters long. When third party applicatoin received that parameter they got only 151 characters, looks like they are truncated by GET method.
    Any idea how to pass parameter using POST format so that this issue could be fixed.
    Regards
    Hitesh

    Sumit,
    Thanks for your reply. I have resolved this issue by forwarding all parameters in session using pageContext.putSessionValueDirect and redirect to a jsp using pageContext.redirectImmediately.
    in jsp I read the params from session and set in the form , and then redirected to my third party application.
    Regards
    Hitesh

  • How to pass parameter /1BCDWB/DOCPARAMS from webdynpro?

    Hi Experts,
    We create a wdp view and indert an adobe form into it. And this form has an interface based on XML schema.
    Now we want to translate this form into multi-language, and in wdp side, we will display diffenent language version of form for different regions.
    I found that there is a paramater /1BCDWB/DOCPARAMS-LANGU, and it seems can control the language version in processing.
    But I donot know how to pass parameter /1BCDWB/DOCPARAMS from wdp to adobe form.
    Its my 1st to use adobe form and wdp, i really have no way out. Any advice will be Appreciated.
    Thank you.
    Richard

    @sahai: Hey no , I am using very very simple example without any query or complex statement. I just have 2 radio buttons in VIEW1. On clicking the radio button, the naviagtion to view2 is done and the value of selected radio button is passed as a parameter in the plug.
    In the view2 , i just have a caption in my layout where i am displaying the parameter value by setting the attribute.THe warning i get is in view2. Here is the code. Apart from this there is no coding in view2.
    METHOD HANDLEPLUG_IN_V2 .
        DATA:
          NODE_CAPT_MSG                       TYPE REF TO IF_WD_CONTEXT_NODE,
          ELEM_CAPT_MSG                       TYPE REF TO IF_WD_CONTEXT_ELEMENT,
          STRU_CAPT_MSG                       TYPE IF_VIEW2=>ELEMENT_CAPT_MSG ,
          ITEM_MSG                            LIKE STRU_CAPT_MSG-MSG.
    *   navigate from <CONTEXT> to <CAPT_MSG> via lead selection
        NODE_CAPT_MSG = WD_CONTEXT->GET_CHILD_NODE( NAME = `CAPT_MSG` ).
    *   get single attribute
        NODE_CAPT_MSG->SET_ATTRIBUTE(
          EXPORTING
            NAME =  `MSG`
            VALUE = PAR_1 ).
    ENDMETHOD.

  • How to pass parameter to intro.jsp page ?

    Hi all,
    Anybody please tell me how to pass parameter to intro.jsp page.
    Is there any param name defined in <forward > syntax ?
    I have made following configuration in struts-config.xml file.
    I want to pass parameter to intro.jsp page
    <global-forwards>
              <forward name="invalidsession" path="/intro.jsp" redirect="true" />
    </global-forwards>
    please reply soon.
    Thanking you.

    Hi all,
    I have a similar kind of question..
    Iam trying to pass a string variable from JSP to servlet thro URL..
    Im using tomcat5
    COde:
    String fname=request.getParamter("filename");
    <jsp:forward page="/servlet/coreservlets.filedownload?name=" +fname />
    It is generating a unterminated tag error..Please help..

  • In jsp file, how to transfer parameter between two javabean?

    In jsp file, how to transfer parameter between two javabean?
    for example
    Bean1 has a attribute A
    Bean2 has a attribute B
    how to transfer the value of A to B

    Have you tried something like...
    <jsp:setProperty name="Bean2" property="B" value="<jsp:getProperty name="Bean1" property="A" />" />

  • How to read URL parameters of one wdp component into other WDP component?

    Dear Experts,
    Can anyone let me know how to read URL parameters of one wdp component into other WDP component?
    My requirement is i have one standard WDP component with 3 URL parameters and i needto
    read that URL parameters along with their values in my Z-WDP component.
    Thanks
    SK

    Hi Santosh,
    You can read parameters send from one WebDynpro Component to another component by adding code in "HANDLEDEFAULT" Event Handler method ( Window )of your target Web Dynpro Component.
    data: lt_parameter             type tihttpnvp,
             ls_parameter             type ihttpnvp.
    lo_api_controller ?= wd_this->wd_get_api( ).
       call method lo_api_controller->get_message_manager
         receiving
           message_manager = lo_message_manager.
       clear : ls_parameter.
       refresh : lt_parameter[].
    * Read all URL parameters
       wdevent->get_data( exporting name = if_wd_application=>all_url_parameters importing value = lt_parameter ).
    if not lt_parameter[] is initial.
         clear : ls_parameter.
         read table lt_parameter into ls_parameter index 1.
         if ls_parameter-name = 'ACTION' and
            ls_parameter-value is initial.
           lv_flag = 'X'.
           clear : lo_msg.
           lo_msg = 'Action Parameter Missing in URL Link !'.
    *         report message
           call method lo_message_manager->report_error_message
             exporting
               message_text = lo_msg.
         else.
         endif.
    Best Regards
    Priyesh Shah

Maybe you are looking for

  • Urgent Help required on Manager Self Service HR AME Rules

    Hi, I am implementing R12 Manager Self Service and creating custom AME rules for routing approvals. Can anyone tell me the steps to create rule for: 1. Change Job in job KFF (What query? Which attribute?) 2. Change Job Title (ass_attribute2 under ass

  • Any ideas how I can view this flv file?

    I have CS3 Flash using Flash Player 9 and Actions Script 3.  I am publishing a progressve loading swf, which has an absolute path to an flv of http://www.haleygroup.com/work_images/basics.flv.  The swf file is located here http://www.haleygroup.com/w

  • Solution Directory

    Hi all Could you please assist. I want to make sure that my Landscape is setup correctly for the "graphical" display to work in the Solution directory. i have used SMSY to create everything. I have a DEV, QAS and PRD on ECC6. When I run SOLUTION_MANA

  • Hash value in report

    Hi sdn, I'm getting hash value in report for one infoobject,that is for 0customer .Could you pls let me know how to remove that particular problem. thanks R

  • Transporting OSS Notes from Dev to QA returns error

    Hi, I have implemented all these notes in Dev: 1448397 1453128 1462423 1465685 1472991 1478699 1486208 1490183 1495277 1512748 1540869 1550964 1558355 1564254 1568563 1575454 I don't get any error during implementation in Dev. When transport to QA, i