Request.getCookies() returns null, not 0 length array

(reposted from J2EE forum)
Just upgraded to 9ias with Embedded OC4J and we were getting a NullPointerException.
Our previous calls to request.getCookies() AKA http://java.sun.com/products/servlet/2.1/api/javax.servlet.http.HttpServletRequest.html#getCookies()
would return an an array of Cookie Objects or an array of zero length if there are no cookies.
When we upgraded to 9ias, we got the NPE.
Know why?
OC4J implementation of HttpServletRequest doesn't return a zero length array, it returns a null object when there are no cookies!!!
So we had to change our code to catch this.
Not a big problem, and it's fixed now, but it was a problem nonetheless.
Any reason/rationale for why this was done this way? Anyone? Bueller?

Josh,
According to Servlet Spec 2.3 (page 193) SRV 15.1.3.2 Methods for (HttpServletRequest SRV.15.1.3) getCookies() returns null if no cookies present. So we are compliant to the spec.
regards
Debu Panda
Oracle That's strange that the NPE problem didn't occurr until deleting cookies on OC4J, then.
Thanks for responding!

Similar Messages

  • Conversion agent; CMException: Request IF_EXEC2 returned null

    Hi all,
    "CMException: Request IF_EXEC2 returned null"
    I'm trying to use a conversion agent serializer to ouput a file from PI 7.1 and am getting the above message in the receiver comm. channel monitor.  No idea what it means.
    This is my first use of conversion agent, so I'm not sure that everything is correctly in place, but the Conversion agent console set-up test works, and I've followed all the blogs I can find so I'm reasonably happy with it.
    Executing the script from the CM console gives me the transformation I want, so my serializer seems OK.
    The PI configuration scenario works fine if I use a receiver channel without the CMTransform bean module (i.e I get an xml file output), so that's OK.
    I get nothing in the NWA logs.
    I'm running out-of-process (64 bit PI system) and the console config looks OK per the admin guide.
    Any ideas folks ?
    Regards,
    Guy

    That's an odd thing.
    When I run it in studio, it completes without any obvious error, but there's no "results" file.
    We had initially installed the 32 bit version (when I was on XI 3.0), and I ran the studio on the XI machine and the results file showed in studio.  But now, my studio is on my PC (not the PI machine).
    However, all that aside, when I execute the CM_Console with my project I get exactly the output I expect...so I'm sure that the serializer is OK.

  • In Portal, request.getparameter return NULL (Sample Monthcalendar)

    I used the sample monthcalendar. When i used it without integrated in portal, i can change month by month with ">>" button.
    In the JSP File, there is a call to the P_CALDATE parameter
    String l_inputDate = request.getParameter("P_CALDATE"); // Input Date.
    When i put this JSP file as an URL Portlet, i can't navigate month by month. the function request.getParameter("P_CALDATE") return NULL, but in the URL i have the parameter:
    http://hddms220.cg63.fr/servlet/page?_pageid=54,58,56&_dad=portal30&_schema=PORTAL30&P_CALDATE=2002-05-01.
    Someone have an idea
    Thanks in advanced

    I have tested the sample with JSERV, and all works fine.
    But if i wan't use OC4J/ORION to display a portlet how can i do it.
    Thanks in advanced

  • In WL6.1 request.getParameter returns NULL for URL parameters that exist

              With the following URL, I get different results between WebLogic 4.5.1 and WebLogic
              6.1:
              http://phx-kmccarthy.medspecialists.net/tsweb/ParametersTest.jsp?apple=macintosh&tree&dog&country=USA
              Weblogic 6.1 returns:
              query string = apple=macintosh&tree&dog&country=USA
              apple = macintosh
              tree = null
              dog = null
              country = USA
              WebLogic 4.5.1 returns:
              query string = apple=macintosh&tree&dog&country=USA
              apple = macintosh
              tree =
              dog =
              country = USA
              here is the jsp...
              <%--
              * ParamtersTest.jsp which shows that empty parameters are ignored in WebLogic
              6.1
              --%>
              <%
              String apple, tree, dog, country;
              apple = request.getParameter("apple");
              tree = request.getParameter("tree");
              dog = request.getParameter("dog");
              country = request.getParameter("country");
              out.println("<br>query string = " + request.getQueryString());
              out.println("<br>apple = " + apple);
              out.println("<br>tree = " + tree);
              out.println("<br>dog = " + dog);
              out.println("<br>country = " + country);
              %>
              From the documentation on the getParameter() method:
              Returns the value of a request parameter as a String, or null if the parameter
              does not exist.
              In my opinion, not existing and being empty are different. Also, every other web
              application environment we've dealt with (including WebLogic 4.5.1) treats them
              as different. If the parameter doesn't have a value, (i.e. ...&tree&dog&...) then
              getParameter() returns the empty string, not null.
              As a result of this we have JSPs that break when running on 6.1.
              

    Found the solution at last. Tomcat servlet container can't handle the chunked transfer-encoding that the J2ME Wireless Toolkit uses when you call outputstream.flush() in midlet. Using outputstream.close() instead of outputstream.flush() will avoid this problem for small requests. For all the codes in the articles on Http Post in Wireless Forum, don't use outputstream.flush() and it will run perfectly - Servlet's request.getParameter(parameterName) will work fine in doPost method.

  • Request.getParameter returns null - Converting webapp from Tomcat to oc4j

    I support a simple web app that passes arguments via url context variables. For some reason it does not work in OC4J. When I use request.getContextPath() I see that the URL string only contains the webapps name, not the whole URL with parameters set.
    BTW it is an OC4J cluster

    *Name:             index.jsp
    *Function:         This page is 1st url for WebApp
    *Information:      This page is used as the home page for this application.
    *Version:          1.0 (created on 2005-06-06)
    * 2.0 052406 pge
    %>
    <%@ page pageEncoding="UTF-8"%>
    <%@ page import="com.hp.itsm.api.*" %>
    <%@ page import="com.hp.itsm.api.interfaces.*" %>
    <%@ page import="java.text.Collator" %>
    <%@ page import="java.util.*"%>
    <%@ page contentType="text/html; charset=utf-8" %>
    <%@ include file="include/variables_initialize.jsp" %>
    <%@ include file="include/methods_global.jsp" %>
    <%@ include file="include/methods_servicedesk.jsp" %>
    <%
    String login = request.getParameter("u");
    String xxx = request.getContextPath();
    //Service Call objects
    ApiSDSession SDsession = null;
    IPerson[] personList = null;
    IAccount accountRequester = null;
    Boolean bError = Boolean.FALSE; //Default to no errors found
    List errMsgList = new ArrayList(); //Array of error messages
    //Get account information
    accountRequester = getAccount(SDsession, login);
    if (accountRequester == null) {
    bError = Boolean.TRUE;
    errMsgList.add("Could not retrieve the accountRequester.");
    }

  • In JSP pages request.getParameter returns null

    There are two jsp's,the first JSP has 1 textbox inside the form tag.We input the values in the textbox and submit.
    Code :Ist jsp
    <BODY>
    <HEAD>
    function validate()
    document.add.submit();
    </HEAD>
    <FORM name="add" method="post" action=/dir/two.jsp" >
    <TABLE width="37%" border="0" align="center" class="c4f3">
    <TR>
    <TD class="c4">Rating</TD>
    <TD><input type=text name="rating"></TD?
    </TR>
    <TR>
    <TD align=center><INPUT type="button" name="submitadd" value="Submit" onClick="validate()" </TD>
    </TR>
    </TABLE>
    </FORM>
    </BODY>
    After the submit it goes to the 2nd JSP page .
    code:2nd Jsp
    <%
    String Rating=request.getParameter("rating");
    out.println(" Rating "+Rating);
    %>
    The 2nd JSP pages gets the values by request.getParameter.When I use method='post' in Ist JSP ,even if I enter values in the textbox, it prints null. But when I give method="get" , it prints the value.
    Pls let me know if there is any problem in the code or its the problem due to webserver configuration.Also suggest the solution to over come this problem.
    Thanks

    If I'am right you have misplaced the opening body-tag of your first jsp-page.
    The opening body-tag should follow after the closing head tag .
    The structure of your HTML-code should look like this:
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>

  • Gmail emails with Read Receipt Request are returned as "Not Read"

    When reading and organizing my emails with my work gmail account that have read receipts attached to them, they are reporting "Not Read", "deleted without being read" even though I have read them. This is happening both from my iPhone and from web based gmail. It seems that upon IMAP syncing, the "Not Read" status goes out.
    I believe this is linked to my iPhone because I emailed one of my coworkers on the same gmail domain an email with a read receipt attached. After he read and archived it from web based emailed (he doesn't have an iPhone), it did not return any response, either "read" or "not read". This is what previously happened with emails viewed on my iPhone.
    Is there some setting for Read Receipts? How can I stop these messages from showing as deleted and not read?
    Thanks!!!

    Just found this thread on GMail sync issues:
    /t5/Nseries-and-S60-Smartphones/N8-Email-Client-Sync-issues-and-deleted-emails-still-appearing/td-p/...
    So far it looks good - after following the advise in the last post by Ali_L sync seems to working. Push does at least, better than ever.
    Short version: 
    1. Remove your GMail account from the N8.
    2. Add your GMail account again, but this time make sure you decline the "Terms of Service" when they are presented to you.
    3. Manually configure sync intervals / GMail IMAP folders etc.

  • Request.getParameter("_ROWKEY") returns null in JDev 3.2

    My SubmitEditForm.jsp uses a bean which inherits from the EditCurrentRecord data web bean. In JDeveloper 3.1 'request.getParameter("ROWKEY")' in this JSP returns the rowkey for the record being edited, but in JDeveloper 3.2 'request.getParameter("_ROWKEY")' returns null. No modifications have bean made to the application - the working JDeveloper 3.1 app has only been compiled in JDeveloper 3.2. Can anyone help please?

    Hi,
    This exception is raised when the multipart/form-data parser has read the number of bytes specified by the Content-Length HTTP header, or tries to read past the end of the input stream, but has not parsed to the end of the message. As implied by the error text, this can happen for a couple of reasons.
    Although its unlikely, it is possible for a client to sent an incorrect Content-Length header. However, we've so far only seen this with a user-written HTTP client. We have yet to see a browser send the wrong value.
    The usual reason for this error is if a user hits the stop button while submitting a form. If the browser has already sent the HTTP header, including Content-Type, then the parser will try to read the entire message. However, this is going to fail, as the browser stops sending the request as soon as the stop button is pressed.
    Finally, there is one more possible reason for this error, and that is if the request is somehow being 'munged' in some way between the browser and the servlet container.
    To help us better understand what is happening here, can you supply
    the following information:
    - Does this problem happen consistently or occur only randomly?
    - When it does happen, is it repeatable, or does it go away if the user hits the submit button again?
    - Does it happen with certain HTML forms, any HTML form, or is it specific to the data entered into a pariticular form?
    - Does it happen with any browser, or a specific version and/or implementation?
    - What is your network configuration? For example, does the problem occur only when going through a proxy server or fire wall.
    - Does it depend on network load? For example, does it happen only at heavy load times?
    - What is you web server configuration, on what platform are you running it, and what JDK version are you using?
    As I'm writing this, the TAR system is down for upgrades - my apologies if you've already supplied this information.
    Regards,
    Simon
    null

  • FindNode returning Null And XML Not Accepting Special Characters

    Hi All,
    i am trying the get the attribute value in the element "ns4:InfoCFDi" using FindNode method, but the method is returning NULL. I used the same code for other sample as well and was successfull. but for this specific XML file(which is below) I am getting a Null.
    i can get till S:Body, but when i try to use FindNode for ":Body/s4:ResponseGeneraCFDi" I get Null value.
    And I used "S:Body/*[local-name()=" | "ns4:ResponseGeneraCFDi" | "]";
    as mentioned in other post but still no success.
    ==>I Have one more question relating to special characters. I need to use characters such as - ó in my XML to read as well as write. When I try to read i am getting XML parse error and when writing, i cannot open the file properly.
    Your help is much appreciated.
    My code is here:
    Local XmlDoc &inXMLDoc, &reqxmldoc;
    Local XmlNode &RecordNode;
    &inXMLDoc = CreateXmlDoc();
    &ret = &inXMLDoc.ParseXmlFromURL("D:\Agnel\Mexico Debit Memo\REALRESPONSE.xml");
    If &ret Then
    &RecordNode = &inXMLDoc.DocumentElement.FindNode("" );
    If &RecordNode.IsNull Then
    Warning MsgGet(0, 0, "Agnel FindNode not found.");
    rem MessageBox(0, "", 0, 0, "FindNode not found");
    Else
    &qrValue = &RecordNode.GetAttributeValue("asignaFolio ");
    Warning MsgGet(0, 0, "asignaFolio." | &qrValue);
    End-If;
    Else
    Warning MsgGet(0, 0, "Error. ParseXmlString");
    End-If;
    XML File:
    - <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    - <S:Body>
    - <ns4:ResponseGeneraCFDi xmlns="http://www.xxl.com/ns/xsd/bf/rxx/52" xmlns:ns2="http://www.sat.gob.mx/cfd/3" xmlns:ns3="http://www.xx/ns/bf/conector/1&quo t; xmlns:ns4="http://www.xx/ns/xsd/bfxx/xx/32&qu ot; xmlns:ns5="http://www.xxcom/ns/xsd/bf/xxxxx&q uot; xmlns:ns6="http://wwwxx.com/ns/referenceID/v1">
    - <ns3:Result version="1">
    <ns3:Message message="Proceso realizado con exito." code="0" />
    </ns3:Result>
    - <ns4:InfoCFDi noCertificadoSAT="20001000000100003992" refId="STORFAC20121022085611" fechaTimbrado="2012-10-22T08:56:45" qr=" "
    uuid="a37a7d92-a17e-49f4-8e4d-51c983587acb" version="3.2" tipo="XML" archivo="xxx" sello="B8WjuhYLouSZJ6LU2EjxZ0a4IKyIENZNBx4Lb4 jkcAk6wA+EM477yz91/iDdsON0jm8xibBfom5hvHsH7ZK1ps3NnAXWr1LW 7ctmGsvYKAMvkCx/yOVzJTKFM2hN+OqCTE0WVfgv690vVy2CDQWKlMxbK+3idwG4t OKCMelrN9c=" fecha="2012-10-22T08:56:44" folio="281" serie="IICC">
    <InfoEspecial valor="Este documento es una representacin impresa de un CFDI." atributo="leyendaImpresion" />
    <InfoEspecial valor="||1.0|a37a7d92-a17e-49f4-8e4d-51c983587acb|2012-10-22T08:56:45|B8WjuhYLouSZJ6LU2EjxZ0a4IKyIENZNBx4Lb4 jkcAk6wA+EM477yz91/iDdsON0jm8xibBfom5hvHsH7ZK1ps3NnAXWr1LW 7ctmGsvYKAMvkCx/yOVzJTKFM2hN+OqCTE0WVfgv690vVy2CDQWKlMxbK+3idwG4t OKCMelrN9c=|20001000000100003992||" atributo="cadenaOriginal" />
    <InfoEspecial valor="Doscientos dieciocho mil cuatrocientos setenta y cinco pesos 00/100 M.N." atributo="totalConLetra" />
    </ns4:InfoCFDi>
    </ns4:ResponseGeneraCFDi>
    </S:Body>
    </S:Envelope>
    TIA

    First of all you have to supply a value you want to search for and this has to be the complete path to the value. You're saying you already tried that, but can you paste the code which you used for that? I don't see the path mentioned in the code you posted.
    *FindNode*
    Syntax
    FindNode(Path)
    Description
    Use the FindNode method to return a reference to an XmlNode.
    The path is specified as the list of tag names, to the node that you want to find, each separated by a slash (/).
    Parameters
    Path
    Specify the tag names up to and including the name of the node that you want returned, starting with a slash and each separated by a slash (/). This is known as the XPath query language.>
    Another option would be this snippet of code:
    &InfoCFDiArray = GetElementsByTagName("ns4:InfoCFDi");
    &InfoCFDiNode = &InfoCFDiArray [1];
    &attValue = &InfoCFDiNode.GetAttributeValue("noCertificadoSAT")
    Warning(&attValue);
    It creates an array of XML Nodes which match the name "ns4:InfoCFDi". Since there's only one in the XML it's safe to assume it will be the one and only node in the array. I've assigned that node to the variable &InfoCFDiNode and use that to retrieve the attribute "noCertificadoSAT" value. The warning message should display the value supplied there.
    Concering the special characters; you will have to change the encoding of the XML. Peoplecode sets this to UTF-8 by default, but doesn't include this in the header. There's a little hack for that somewhere on the web, I'll see if I can find it.

  • Request.getParameter() always returns null

    I have a html file and am trying to retrieve the values from a formin my servlet.
    here is the html code:
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <h1><b>Add DVD</b></h1>
    </head>
    <body>
    <form action="add_dvd.do" method="POST">
    Title:<input type="text" name="title" />
    Year:<input type="text" name="year" />
    Genre: <select name='gselected'>
    <option value='Sci-Fi'>Sci-Fi</option>
    </select>
    or enter new genre:<input type="text" name='gentered' value="" />
    <input type="submit" value="Add DVD" />
    </form>
    </body>
    </html>
    and here is the servlet code:
    public class AddDVDServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    // System.out.println("in AddDVDServlet post method");
    List errorMsgs = new LinkedList();
    //retrieve form parameters
    try{
    String title = request.getParameter("title").trim();
    String year = request.getParameter("year").trim();
    *String gentered = request.getParameter("gentered");
    String gselected = request.getParameter("gselected");
    String genre="";
    if("".equals(gentered))
    genre = gselected;
    else
    genre = gentered;
    // System.out.println("parameter retrieved");
    if(!year.matches("\\d\\d\\d\\d"))
    // System.out.println("year not 4 digit long");
    errorMsgs.add("Year must be four digit long");
    if("".equals(title))
    // System.out.println("title not entered");
    errorMsgs.add("Please enter the title of the dvd");
    if("".equals(genre))
    // System.out.println("genre not valid");zdf
    errorMsgs.add("Enter genre.");
    if(! errorMsgs.isEmpty())
    //System.out.println("errors in entry ");
    request.setAttribute("errors",errorMsgs);
    // System.out.println("error attribute set in request");
    RequestDispatcher rd = request.getRequestDispatcher("error.view");
    rd.forward(request, response);
    return;
    //create DVDItem instance
    DVDItem dvd = new DVDItem(title,year,genre);
    request.setAttribute("dvdItem",dvd);
    RequestDispatcher rd = request.getRequestDispatcher("success.view");
    rd.forward(request, response);
    catch(Exception e){
    errorMsgs.add(e.getMessage());
    request.setAttribute("errors",errorMsgs);
    RequestDispatcher rd = request.getRequestDispatcher("error.view");
    rd.forward(request, response);
    e.printStackTrace();
    System.out.println("exception:"+e);
    why does getParameter always return null??? whats wrong?

    I don't know. However, I suspect that because you have a tag with the same name as 'title', its causing a name conflict. Chnage the name to something else. If it works, then that's the likely explaination.

  • Graphics returning null in one place, but not another.

    If you want to compile and run my program.... you can get all the files here:
    http://s94182144.onlinehome.us/randomstuff/files.zip
    (The main classes you'll need to look at are DrawingCanvas, Trig and GraphEngine)
    Here's a visual just in case:
    http://s94182144.onlinehome.us/randomstuff/graph.jpg
    When I click the "Graph It" button, I'm sending all those variables in the window to another class. Except the method I need to call is passed Graphics g... and thus, I needed to create a graphics variable. But it's returning null.
    Here is my code in GraphEngine, which runs when a button is clicked. You'll notice for Graph It... I created a Graphics variable... this returns null. Except you'll also notice I do the same thing for "Clear"... but this works.
    NOTE: I was getting mad so I named some methods not so nicely :p .... you may notice they are different in my files.
         public void actionPerformed(ActionEvent e)
              userDisplay=e.getActionCommand();
              if(userDisplay.equals("Draw"))
                   String progChoice=grapher.graphType.getSelectedItem();
                   System.out.println(progChoice);
                   if(progChoice.equals("Lines"))
                        grapher.allButtons[0].enable();
                        draw();
                   else if(progChoice.equals("Scatter Plot"))
                        lineOfBestFit();
              else if(userDisplay.equals("Graph It"))
                   Trig.graphThisStuff();
                   Graphics g = canvas.getGraphics();
                   canvas.trig(g);
               else if(userDisplay.equals("Clear"))
                    Graphics g = canvas.getGraphics();
                   System.out.println(g);
                    canvas.clear(g);
            else if(userDisplay.equals("Reset"))
                Trig.restartThis();   
              else if(userDisplay.equals("Credits"))
                showInstructionsFrame();
            else if(userDisplay.equals("Help"))
                showHelpFrame();   
            else if(userDisplay.equals("Create Sinusodial Graph"))
                showTrigFrame();   

    1. Do you expect forum members to download and unzip your code? Good luck...
    2. Inside almost every "big" problem is a small one trying to get out. Write a minimal program
    demonstrating your problem (say <50 lines) and post that. The shorter code and the easier it
    is to copy, paste and run, the more forum members will actually give it a go.
    That being said, you problem is that you are using Component's getGraphics at all. Don't use it.
    It doesn't work very well -- they rendering you do is temporary, if you iconify and restore your
    window your changes will disappear (sometimes even moving another window past yours will do this!).
    What should you do instead? Put all your rendering code in paintComponent (or subroutines
    it calls). Changes in state of your app should trigger a call to repaint (or you will call it directly).
    Repainting will eventually cause your paintComponent to be called.

  • BufferedReader readLine() not returning null

    I'm trying write an SMTP client using Socket.
    I'm sending EHLO command to the SMTP server is is returning multiline response. When I tried to read this multiline response using the BufferedReader in a while loop, it is never returning null.
    Following is my code snippet
    while(true)
                    data=reader.readLine();
                    multilineData +=data+"\r\n";
                    if(data==null )
                        break;
                    }why it is not returning?

    I have written debug statements.
    It is printing the following lines and it still expecting something from the server even though server has finished sending all the response.
    250-mail.merakdemo.com Hello <hostname>, pleased to meet you.
    250-ENHANCEDSTATUSCODES
    250-SIZE
    250-EXPN
    250-ETRN
    250-ATRN
    250-DSN
    250-CHECKPOINT
    250-8BITMIME
    250-AUTH CRAM-MD5 DIGEST-MD5 LOGIN PLAIN
    250-AUTH=LOGIN
    250-STARTTLS
    250 HELP
    This is the end of response from server.
    And even I tried to break the while loop by checking the "HELP" String in the response. It is breaking the loop, but it is never returning the control.
    Following is the Code snippet:
    private String pullMultilineData(BufferedReader reader) throws CommunicationException
           String multilineData="";
           String data="";
            try
                while(true)
                    data=reader.readLine();
                    multilineData +=data+"\r\n";
                    // as per SMTP Protocol last line is without "-"
                    if(data==null || data.equals("") || data.indexOf("-")==-1)
                                        break;
                   logger.log(Level.DEBUG, "Data: "+data);
            catch(IOException ioe)
                logger.log(Level.ERROR, "I/O exception: "+ioe);
                throw new CommunicationException("unable to pull the respose, i/o error occured");
           return multilineData;
        }

  • PageDef operatingBinding is not visible or returning null

    Hi,
    I have an ADF application with taskflow which contains a page fragement which has some methodAction bindings in its pageDef.
    I dragged this taskflow as a region in a Webcenter Portal application project page which has a pageTemplate. When that page opens, it opens fine by initializing the page which involves invoking some methodAction bindings.
    After the page got loaded, I click on a button, this again requires methodAction bindings but this time that operationBinding is returning null. so, I am not able to invoke the method.
    I am getting the operatingBinding in my managed bean as below. operatingBinding is fine while loading the page (init method) but it is giving null when I click on any button in the page after page load.
    OperationBinding operationBinding = getBindings().getOperationBinding("getPersonId")
    public BindingContainer getBindings() {
    if(this.bindings == null){
    FacesContext fc = FacesContext.getCurrentInstance();
    this.bindings = (BindingContainer)fc.getApplication().evaluateExpressionGet(fc, "#{bindings}", BindingContainer.class);
    return bindings;
    I dragged the same taskflow to an other ADF application and it worked fine before and after loading the page. I do not understand why it is not working in portal application. But it is nothing to do with Webcenter I believe. I just wanted to know if anyone faced this issue before. Please give some pointers if you have any.
    regards
    Vinay Kumar

    Page Definition is
    *<?xml version="1.0" encoding="UTF-8" ?>*
    *<pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"*
    version="11.1.1.59.23" id="SearchFragmentPageDef"
    Package="com.johnlewis.cpl.wcportal.ui">
    *<parameters/>*
    *<executables>*
    *<variableIterator id="variables"/>*
    *<iterator Binds="PartnerHrchy" RangeSize="25"*
    DataControl="PartnerSearchAMDataControl"
    id="PartnerHrchyIterator"/>
    *<iterator Binds="PartnerSearchTempVO1" RangeSize="25"*
    DataControl="PartnerSearchAMDataControl"
    id="PartnerSearchTempVO1Iterator"/>
    *<searchRegion Binds="PartnerSearchTempVO1Iterator" Criteria=""*
    Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
    id="PartnerSearchTempVO1Query"/>
    *</executables>*
    *<bindings>*
    *<methodAction id="getPersonId"*
    InstanceName="PartnerSearchAMDataControl.dataProvider"
    DataControl="PartnerSearchAMDataControl"
    RequiresUpdateModel="true" Action="invokeMethod"
    MethodName="getPersonId" IsViewObjectMethod="false"
    ReturnName="data.PartnerSearchAMDataControl.methodResults.getPersonId_PartnerSearchAMDataControl_dataProvider_getPersonId_result">
    *<NamedData NDName="uname" NDType="java.lang.String"/>*
    *</methodAction>*
    *<methodAction id="initPartnerSearch"*
    InstanceName="PartnerSearchAMDataControl.dataProvider"
    DataControl="PartnerSearchAMDataControl"
    RequiresUpdateModel="true" Action="invokeMethod"
    MethodName="initPartnerSearch" IsViewObjectMethod="false"
    ReturnName="data.PartnerSearchAMDataControl.methodResults.initPartnerSearch_PartnerSearchAMDataControl_dataProvider_initPartnerSearch_result">
    *<NamedData NDName="uname" NDType="java.lang.String"/>*
    *</methodAction>*
    *<methodAction id="searchPartnerTempTable"*
    InstanceName="PartnerSearchAMDataControl.dataProvider"
    DataControl="PartnerSearchAMDataControl"
    RequiresUpdateModel="true" Action="invokeMethod"
    MethodName="searchPartnerTempTable"
    IsViewObjectMethod="false">
    *<NamedData NDName="uname" NDType="java.lang.String"/>*
    *<NamedData NDName="param" NDType="java.lang.String"/>*
    *<NamedData NDName="leavers" NDType="java.lang.String"/>*
    *</methodAction>*
    *<tree IterBinding="PartnerHrchyIterator" id="PartnerHrchy">*
    *<nodeDefinition DefName="com.johnlewis.cpl.wcportal.model.view.PartnerHrchy"*
    Name="PartnerHrchy0">
    *<AttrNames>*
    *<Item Value="FullName"/>*
    *<Item Value="Position"/>*
    *<Item Value="LocationCode"/>*
    *</AttrNames>*
    *<Accessors>*
    *<Item Value="PositionIdPartnerHrchy"/>*
    *</Accessors>*
    *</nodeDefinition>*
    *</tree>*
    *<tree IterBinding="PartnerSearchTempVO1Iterator" id="PartnerSearchTempVO1">*
    *<nodeDefinition DefName="com.johnlewis.cpl.wcportal.model.view.PartnerSearchTempVO"*
    Name="PartnerSearchTempVO10">
    *<AttrNames>*
    *<Item Value="PartnerName"/>*
    *<Item Value="EmployeeNumber"/>*
    *<Item Value="SecurityProfileName"/>*
    *<Item Value="ResponsibilityName"/>*
    *<Item Value="PositionCode"/>*
    *<Item Value="LocationCode"/>*
    *</AttrNames>*
    *</nodeDefinition>*
    *</tree>*
    *</bindings>*
    *</pageDefinition>*
    Managed Bean code to invoke methodAction is
    *public void myTimeCard(ActionEvent actionEvent) {*
    *// Add event code here...*
    String uname = null;
    uname = ADFContext.getCurrent().getSecurityContext().getUserName();
    System.out.println("User name is " + uname);
    OperationBinding operationBinding = getBindings().getOperationBinding("getPersonId");
    System.out.println("Before setting parameters");
    System.out.println("operationBinding is " + operationBinding);
    *if(operationBinding != null){*
    operationBinding.getParamsMap().put("uname", uname);
    System.out.println("After setting parameters");
    String out = (String)operationBinding.execute();
    System.out.println("After invoking method");
    System.out.println("Person Id from getPersonId is " + out);
    if(out != null)
    personId = Long.parseLong(out);
    System.out.println("Person Id of search is " + personId);
    System.out.println("User name is " + uname);
    ADFContext.getCurrent().getPageFlowScope().put("personId", personId);
    ADFContext.getCurrent().getPageFlowScope().put("respId", null);
    ADFContext.getCurrent().getPageFlowScope().put("type", "ess");
    ADFContext.getCurrent().getPageFlowScope().put("userName",uname); //TODO username need to be passed from security Context
    *}*

  • Call thirty party java web service but always return null

    hi
    I call a java web service in my application visual studio 2008 c#, but always return NULL.
    I used Tool Fiddler to monitor the traffic between my client and the web service server, it showed the return is not Null.
    Here is my code, please see if anything I do wrong.
    namespace CanOfficer_THQ_vs_IHQ.TestWebReferenceAppointment {
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="AppointmentServiceSoapBinding", Namespace="http://service.ips.salvationarmy.org/")]
    public partial class AppointmentService : Microsoft.Web.Services3.WebServicesClientProtocol {
    private System.Threading.SendOrPostCallback deleteAppOperationCompleted;
    private System.Threading.SendOrPostCallback importAppOperationCompleted;
    private System.Threading.SendOrPostCallback editAppOperationCompleted;
    private bool useDefaultCredentialsSetExplicitly;
    /// <remarks/>
    public AppointmentService() {
    this.Url = global::CanOfficer_THQ_vs_IHQ.Properties.Settings.Default.CanOfficer_THQ_vs_IHQ_TestWebReferenceAppointment_AppointmentService;
    if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
    this.UseDefaultCredentials = true;
    this.useDefaultCredentialsSetExplicitly = false;
    else {
    this.useDefaultCredentialsSetExplicitly = true;
    public new string Url {
    get {
    return base.Url;
    set {
    if ((((this.IsLocalFileSystemWebService(base.Url) == true)
    && (this.useDefaultCredentialsSetExplicitly == false))
    && (this.IsLocalFileSystemWebService(value) == false))) {
    base.UseDefaultCredentials = false;
    base.Url = value;
    public new bool UseDefaultCredentials {
    get {
    return base.UseDefaultCredentials;
    set {
    base.UseDefaultCredentials = value;
    this.useDefaultCredentialsSetExplicitly = true;
    /// <remarks/>
    public event deleteAppCompletedEventHandler deleteAppCompleted;
    /// <remarks/>
    public event importAppCompletedEventHandler importAppCompleted;
    /// <remarks/>
    public event editAppCompletedEventHandler editAppCompleted;
    /// <remarks/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute(
    RequestNamespace="http://service.ips.salvationarmy.org/",
    ResponseNamespace="http://service.ips.salvationarmy.org/",
    Use=System.Web.Services.Description.SoapBindingUse.Encoded,
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public string deleteApp([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] int id) {
    object[] results = this.Invoke("deleteApp", new object[] {
    id});
    return ((string)(results[0]));
    /// <remarks/>
    public void deleteAppAsync(int id) {
    this.deleteAppAsync(id, null);
    /// <remarks/>
    public void deleteAppAsync(int id, object userState) {
    if ((this.deleteAppOperationCompleted == null)) {
    this.deleteAppOperationCompleted = new System.Threading.SendOrPostCallback(this.OndeleteAppOperationCompleted);
    this.InvokeAsync("deleteApp", new object[] {
    id}, this.deleteAppOperationCompleted, userState);
    private void OndeleteAppOperationCompleted(object arg) {
    if ((this.deleteAppCompleted != null)) {
    System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
    this.deleteAppCompleted(this, new deleteAppCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
    /// <remarks/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute(
    RequestNamespace="http://service.ips.salvationarmy.org/",
    ResponseNamespace="http://service.ips.salvationarmy.org/",
    Use=System.Web.Services.Description.SoapBindingUse.Encoded,
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public string importApp(
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] int person,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string name,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string territory,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string location,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] bool primary,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> start,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> end,
    [System.Xml.Serialization.XmlElementAttribute("categories", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string[] categories) {
    object[] results = this.Invoke("importApp", new object[] {
    person,
    name,
    territory,
    location,
    primary,
    start,
    end,
    categories});
    return ((string)(results[0]));
    /// <remarks/>
    public void importAppAsync(int person, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories) {
    this.importAppAsync(person, name, territory, location, primary, start, end, categories, null);
    /// <remarks/>
    public void importAppAsync(int person, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories, object userState) {
    if ((this.importAppOperationCompleted == null)) {
    this.importAppOperationCompleted = new System.Threading.SendOrPostCallback(this.OnimportAppOperationCompleted);
    this.InvokeAsync("importApp", new object[] {
    person,
    name,
    territory,
    location,
    primary,
    start,
    end,
    categories}, this.importAppOperationCompleted, userState);
    private void OnimportAppOperationCompleted(object arg) {
    if ((this.importAppCompleted != null)) {
    System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
    this.importAppCompleted(this, new importAppCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
    /// <remarks/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute(
    RequestNamespace="http://service.ips.salvationarmy.org/",
    ResponseNamespace="http://service.ips.salvationarmy.org/",
    Use=System.Web.Services.Description.SoapBindingUse.Encoded,
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public string editApp(
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] int id,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string name,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string territory,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string location,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] bool primary,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> start,
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> end,
    [System.Xml.Serialization.XmlElementAttribute("categories", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string[] categories) {
    object[] results = this.Invoke("editApp", new object[] {
    id,
    name,
    territory,
    location,
    primary,
    start,
    end,
    categories});
    return ((string)(results[0]));
    /// <remarks/>
    public void editAppAsync(int id, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories) {
    this.editAppAsync(id, name, territory, location, primary, start, end, categories, null);
    /// <remarks/>
    public void editAppAsync(int id, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories, object userState) {
    if ((this.editAppOperationCompleted == null)) {
    this.editAppOperationCompleted = new System.Threading.SendOrPostCallback(this.OneditAppOperationCompleted);
    this.InvokeAsync("editApp", new object[] {
    id,
    name,
    territory,
    location,
    primary,
    start,
    end,
    categories}, this.editAppOperationCompleted, userState);
    private void OneditAppOperationCompleted(object arg) {
    if ((this.editAppCompleted != null)) {
    System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
    this.editAppCompleted(this, new editAppCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
    /// <remarks/>
    public new void CancelAsync(object userState) {
    base.CancelAsync(userState);
    private bool IsLocalFileSystemWebService(string url) {
    if (((url == null)
    || (url == string.Empty))) {
    return false;
    System.Uri wsUri = new System.Uri(url);
    if (((wsUri.Port >= 1024)
    && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
    return true;
    return false;
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    public delegate void deleteAppCompletedEventHandler(object sender, deleteAppCompletedEventArgs e);
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class deleteAppCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
    private object[] results;
    internal deleteAppCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
    base(exception, cancelled, userState) {
    this.results = results;
    /// <remarks/>
    public string Result {
    get {
    this.RaiseExceptionIfNecessary();
    return ((string)(this.results[0]));
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    public delegate void importAppCompletedEventHandler(object sender, importAppCompletedEventArgs e);
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class importAppCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
    private object[] results;
    internal importAppCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
    base(exception, cancelled, userState) {
    this.results = results;
    /// <remarks/>
    public string Result {
    get {
    this.RaiseExceptionIfNecessary();
    return ((string)(this.results[0]));
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    public delegate void editAppCompletedEventHandler(object sender, editAppCompletedEventArgs e);
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class editAppCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
    private object[] results;
    internal editAppCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
    base(exception, cancelled, userState) {
    this.results = results;
    /// <remarks/>
    public string Result {
    get {
    this.RaiseExceptionIfNecessary();
    return ((string)(this.results[0]));

    Hi;
    I used Fiddler to monitor the process, and it showed the request sent thru web service worked and returned a value, but in my .Net application the return captured as NULL. Could you please look into the code above and the result from Filddler and see if
    you can help.
    thank you.
    REQUEST:
    POST https://159.253.140.178/services/AppointmentService HTTP/1.1
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.4252)
    Content-Type: text/xml; charset=utf-8
    SOAPAction: ""
    Host: 159.253.140.178
    Content-Length: 1589
    Expect: 100-continue
    Connection: Keep-Alive
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://service.ips.salvationarmy.org/" xmlns:types="http://service.ips.salvationarmy.org/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
    <soap:Header>
    <wsse:Security mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>
    [email protected]
    </wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">
    tpi4IPSws!
    </wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soap:Header>
    <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:importApp>
    <person xsi:type="xsd:int">
    169275
    </person>
    <name xsi:type="xsd:string">
    Corps Officer (Cahul-Russia) Test12
    </name>
    <territory xsi:type="xsd:string">
    CAN
    </territory>
    <location xsi:type="xsd:string">
    TEST LOCATION 12
    </location>
    <primary xsi:type="xsd:boolean">
    true
    </primary>
    <start xsi:type="xsd:dateTime">
    2013-05-30T00:00:00
    </start>
    <end xsi:type="xsd:dateTime">
    2014-06-04T00:00:00
    </end>
    <categories href="#id1" />
    </tns:importApp>
    <soapenc:Array id="id1" soapenc:arrayType="xsd:string[1]">
    <Item>
    vpsCat1
    </Item>
    </soapenc:Array>
    </soap:Body>
    </soap:Envelope>
    RESPONSE:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Content-Type: text/xml;charset=UTF-8
    Content-Length: 232
    Date: Fri, 05 Sep 2014 19:45:22 GMT
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <ns2:importAppResponse xmlns:ns2="http://service.ips.salvationarmy.org/">
    <return>
    OK_572463
    </return>
    </ns2:importAppResponse>
    </soap:Body>
    </soap:Envelope>

  • Why does getParameter("uri") returns null ???

    Hi !
    JAVA can be rather frustrating and I have run of of dukes. How about IOU ?
    Unfortunately none of the previous questions in the db shed light on my problem.
    I am trying to get at the "uri" and I have the following code fragment :
    package com.developer;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.IOException;
    import java.io.PrintWriter;
    public class proptest extends HttpServlet
      public void doGet( HttpServletRequest req,  HttpServletResponse resp)
        throws ServletException, IOException
        PrintWriter out = resp.getWriter();
        out.println("Parameter Name: " + req.getParameter("uri"));
      public void init() throws ServletException
        // initialie the servlet here. Use ServletConfig object to get
        //    initialization parameters...
        ServletConfig config = getServletConfig();
        // ... more stuff ...
      }

    Hi!
    In case anyone stumbles upon this in the database, I worked aroung it by using req.getRequestURI().
    However I still do not know why getParameter() returns null. It would be useful e.g. if you want to display a list of all request params e.g.:
    // stub code follows...
    java.util.Enumeration enum = rea.getParameterNames();
    while (enum.hasMoreElements())
    String name = (String) enum.nextElement();
    System.out.println("Parameter "+name + " " + req.getParameter(name))
    ...For me, nope, all nulls. If it works for you , do tell me.
    Also if you look at the "bugs db" there seems to be a number of issues concerning getParameter().

Maybe you are looking for