JFrame getLocation() always returns (0, 0)

I am learning Java, and I am trying to port a silly program I made in VB.NET that bounces a green window around the screen. I think I have it all set up, except for the fact that I can't tell when the frame hits the edge of the screen (to bounce) because JFrame.getLocation() always returns (0, 0)! In addition, JFrame.setLocation(int, int) sets the location relative to the frame's current location. I'm baffled, and to new to understand why this is happening!
Here's the code, made in Eclipse IDE. The commented out section is the bouncing code that doesn't work because of my getLocation() problem. The two class files are separated by the big star line.
Right now I'm not concerned with efficiency or perfect coding, just this specific problem. However, feel free to straighten up the code (for example, I'm sure a while(true) block is not a good idea, but it works for now).
import java.awt.Toolkit;
public class Move {
     static Mover mover = new Mover();
     static int xDir = 5;
     static int yDir = 5;
     static int sleepTime = 100;
     public static void main(String[] args) {
          beginMove();
     private static void beginMove() {
          while(true) {
               /*if(mover.getLocation().x <= 0) {
                    xDir = (-xDir);
               if(mover.getLocation().y <= 0) {
                    yDir = (-yDir);
               if(mover.getLocation().x >= Toolkit.getDefaultToolkit().getScreenSize().width) {
                    xDir = (-xDir);
               if(mover.getLocation().y >= Toolkit.getDefaultToolkit().getScreenSize().height) {
                    yDir = (-yDir);
               mover.move(xDir, yDir);
               try {Thread.sleep(sleepTime);} catch (InterruptedException e) {}
import java.awt.Color;
import java.awt.Point;
import javax.swing.JFrame;
public class Mover extends JFrame {
     public JFrame mover = new JFrame();
     public Mover() {
          mover.setSize(100, 100);
          mover.setUndecorated(true);
          mover.getContentPane().setBackground(Color.green);
          mover.setLocation(100, 100);
          mover.setVisible(true);
     public void move(int xAmt, int yAmt) {
          mover.setLocation((mover.getLocation().x + xAmt), (mover.getLocation().y + yAmt));
}

Looks like I spoke to soon... After I changed the mover class as you did, this is thrown:
Exception in thread "main" java.lang.StackOverflowError
     at java.awt.Component.setLocation(Unknown Source)
     at Mover.move(Mover.java:16)It prints the last two lines about 500 times (literally) then quits. Line 16 is setLocation(getX() + xAmt, getY() + yAmt); and the error goes away if this is removed.
When I try to move the frame in the mover class (mover.setLocation(10, 10);), nothing happens.
EDIT: It works when I use setBounds(). Why doesn't setLocation work???
Edited by: crimsondynamo329 on Oct 20, 2009 2:19 PM

Similar Messages

  • RowAtPoint and columnAtPoint always return 0

    //in NormalGUI
         ptsinfo.addActionListener(new NTListener());
         delete.addActionListener(new NTListener());
         nTable.addMouseListener(new NTListener());
    //in NormalGUI
    public class NTListener extends MouseAdapter implements ActionListener{
         int selectRow,selectColumn;
         public void mousePressed(MouseEvent e){
              if (e.isPopupTrigger()) {
                   showPopup(e);
         public void mouseReleased(MouseEvent e){
              if (e.isPopupTrigger()) {
                   showPopup(e);
         public void showPopup(MouseEvent e){
              NormalGUI.nPop.show(e.getComponent(), e.getX(), e.getY());
              selectRow = NormalGUI.nTable.rowAtPoint(new Point(e.getX(),e.getY()));
              selectColumn = NormalGUI.nTable.columnAtPoint(new Point(e.getX(),e.getY()));
              System.out.println(new Point(e.getX(),e.getY()));     
    }the point printed has not problem but rowAtPoint and columnAtPoint.
    The popup menu shows at the right point
    I try to use e.getSource and find that it really from nTable.
    they are always return 0 instead of -1?
    Why it happens? Thanks.

    Darryl.Burke wrote:
    Doesn't happen to me. To get better help sooner, post a SSCCE that clearly demonstrates your problem.
    db
    import javax.swing.table.*;
    import javax.swing.*;
    import java.util.*;
    class NTable extends AbstractTableModel{
         static Object[] cells = {"",".mpg","&#22823;&#22618;&#24859;","&#12518;&#12513;&#12463;&#12452;",Boolean.FALSE,"2006-08-04","","M&#12473;&#12486;","00:02:34","1440x1080","323014660","","","[HDTV] &#22823;&#22618;&#24859; - [2006.08.04] - &#12518;&#12513;&#12463;&#12452; ( M&#12473;&#12486; - 17Mbps 2m34s 1440x1080).mpg","&#22823;&#22618;&#24859; - &#12518;&#12513;&#12463;&#12452; (2006.08.04 M&#12473;&#12486;) .ts",new Integer(0)};
         static Object[] cells2 = {"",".m2t","&#22823;&#22618;&#24859;","&#37329;&#39770;&#33457;&#28779;",Boolean.FALSE,"2004-08-29","BShi","BEAT MOTION","00:02:32","1440x1080","397588604","","","[HDTV-TS] &#22823;&#22618;&#24859; - [2004.08.29] - &#37329;&#39770;&#33457;&#28779; (BShi BEAT MOTION - 20Mbps 2m32s 1440x1080).m2t","&#22823;&#22618;&#24859;-&#37329;&#39770;&#33457;&#28779;[BEAT.MOTION.2004.08.29].ts",new Integer(0)};
         int noOfFile;
         static String[] col = {"no.","Suffix","Artist","Songs","Talk","Date","TV station","Program","Duration","Resolution","Filesize","ptsinfo","Date added","new name","old name","rare"};
         static ArrayList<Object[]> datas = new ArrayList<Object[]>();
         public NTable(){
                   datas.add(cells);
                   datas.add(cells2);
         public int getRowCount(){
              return datas.size();
         public int getColumnCount(){
              return col.length;
        public Object getValueAt(int r, int c){
             if(c==0){
                  return String.format("%04d", r+1);
            return getDataList(r)[c];      
         public Class getColumnClass(int c){
              if(c==11){
                   try{
                        return JButton.class;
                   }catch(Exception e){}
              return getDataList(0)[c].getClass();
         public String getColumnName(int c){
              return col[c];
         public void setValueAt(Object obj, int r, int c){
              Object[] tempArray = getDataList(r);
              tempArray[c] = obj;
              datas.set(r, tempArray);
              if(c==15){
                   NormalGUI.nTable.changeSelection(r+1, c, false, false);
         public boolean isCellEditable(int r, int c){
              if(c>0&&c<=10||c==15){
                   return true;
              }else{
                   return false;
         public static int getdatas(){
              try{
                   return datas.size();
              }catch(Exception e){
                   return 0;
         public static Object[] getDataList(int r){
              return datas.get(r);
    import java.awt.Point;
    import java.awt.event.*;
    public class NTListener extends MouseAdapter implements ActionListener{
         int selectRow,selectColumn;
         public void mousePressed(MouseEvent e){
            if (e.isPopupTrigger()) {
                 showPopup(e);
         public void mouseReleased(MouseEvent e){
            if (e.isPopupTrigger()) {
                 showPopup(e);
         public void mouseClicked(MouseEvent e){}     
         public void mouseExited(MouseEvent e){}
         public void mouseEntered(MouseEvent e){}
         public void showPopup(MouseEvent e){
              NormalGUI.nPop.show(e.getComponent(), e.getX(), e.getY());
             selectRow = NormalGUI.nTable.rowAtPoint(new Point(e.getX(),e.getY()));
             selectColumn = NormalGUI.nTable.columnAtPoint(new Point(e.getX(),e.getY()));
             System.out.println(new Point(e.getX(),e.getY()));     
         public void actionPerformed(ActionEvent e){
              if(e.getSource().equals(NormalGUI.ptsinfo)){
                    try {
                         Runtime rt = Runtime.getRuntime();               
                         Process prcs = rt.exec("C:\\WINDOWS.0\\AppPatch\\AppLoc.exe \"E:\\(A)&#31243;&#24335; (F)\\&#30475;&#22294;&#25991;&#38899;&#27138;&#39006;\\ptsInfo050\\ptsinfo.exe\" \"/L0411\"");
                         } catch(Exception ioe) { System.out.println(ioe); }
              }else if(e.getSource().equals(NormalGUI.delete)){
                   System.out.println(selectRow+"+"+selectColumn);
                   NTable.datas.remove(selectRow);
                   NormalGUI.nTable.updateUI();
    import java.awt.Font;
    import javax.swing.*;
    import javax.swing.table.TableColumn;
    import javax.swing.table.TableModel;
    public class NormalGUI extends JFrame{
         static TableModel nModel;
         static JTable nTable;
         static JScrollPane nPanel;
         static JPopupMenu nPop = new JPopupMenu();
         static JMenuItem ptsinfo = new JMenuItem("Open ptsinfo");
         static JMenuItem delete = new JMenuItem("Delete this file");
         public NormalGUI(){
              setBounds(0,0,500,500);
              nModel = new NTable();
              nTable = new JTable(nModel);   
              nPanel = new JScrollPane(nTable);
              nTable.setRowHeight(20);
              int[] columnWidth={45,145,100,150,45,105,95,200,85,105,115,65,100,900,400,40};
              nTable.setFont(new Font("&#24494;&#36575;&#27491;&#40657;&#39636;", Font.BOLD, 16));
              nTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
              nTable.addMouseListener(new NTListener());
              ptsinfo.addActionListener(new NTListener());
              delete.addActionListener(new NTListener());
              nPop.add(ptsinfo);
              nPop.add(delete);
              TableColumn column;
              for (int i = 0; i<nTable.getColumnCount(); i++) {               
                   column = nTable.getColumnModel().getColumn(i);
                   column.setPreferredWidth(columnWidth);
              add(nPanel);
              setVisible(true);
         public static void main(String[] args){
              new NormalGUI();

  • 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.

  • My iphone 4 is stuck on the hello screen...with a white background after i tried to update it.  How do i correct this?  I have already gone to itunes and backed it up.  But after i back it up it always return to the hello screen in  different languages ?

    My iphone 4 is stuck in the setup phase with a white background.  It tells me hello in several diffrent  languages and tells me to slide to set up.  I have already backed it up on itunes several times but it always returns to the hello screen with the white back ground.  Can anyone please help me with this?  All of this happened after i updated it for the 1st time. Help pLease?
    Edward

    Hello Edward
    Follow the prompts on your iPhone and you will get either at your home screen like normal or get to a point of restoring from back up. The article below will give step by step for restoring from back up.
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Global Temp Table, always return  zero records

    I call the procedure which uses glbal temp Table, after executing the Proc which populates the Global temp table, i then run select query retrieve the result, but it alway return zero record. I am using transaction in order to avoid deletion of records in global temp table.
    whereas if i do the same thing in SQL navigator, it works
    Cn.ConnectionString = Constr
    Cn.Open()
    If FGC Is Nothing Then
    Multiple = True
    'Search by desc
    'packaging.pkg_msds.processavfg(null, ActiveInActive, BrandCode, Desc, Itemtype)
    SQL = "BEGIN packaging.pkg_msds.processavfg(null,'" & _
    ActiveInActive & "','" & _
    BrandCode & "','" & _
    Desc & "','" & _
    Itemtype & "'); end;"
    'Here it will return multiple FGC
    'need to combine them
    Else
    'search by FGC
    SQL = "BEGIN packaging.pkg_msds.processavfg('" & FGC & "','" & _
    ActiveInActive & "','" & _
    BrandCode & "',null,null); end;"
    'will alway return one FGC
    End If
    ' SQL = " DECLARE BEGIN rguo.pkg_msds.processAvedaFG('" & FGC & "'); end;"
    Stepp = 1
    Cmd.Connection = Cn
    Cmd.CommandType = Data.CommandType.Text
    Cmd.CommandText = SQL
    Dim Trans As System.Data.OracleClient.OracleTransaction
    Trans = Cn.BeginTransaction()
    Cmd.Transaction = Trans
    Dim Cnt As Integer
    Cnt = Cmd.ExecuteNonQuery
    'SQL = "SELECT rguo.pkg_msds.getPDSFGMass FROM dual"
    SQL = "select * from packaging.aveda_mass_XML"
    Cmd.CommandType = Data.CommandType.Text
    Cmd.CommandText = SQL
    Adp.SelectCommand = Cmd
    Stepp = 2
    Adp.Fill(Ds)
    If Ds.Tables(0).Rows.Count = 0 Then
    blError = True
    BlComposeXml = True
    Throw New Exception("No Record found for FGC(Finished Good Code=)" & FGC)
    End If
    'First Row, First Column contains Data as XML
    Stepp = 0
    Trans.Commit()

    Hi,
    This forum is for Oracle's Data Provider and you're using Microsoft's, but I was curious so I went ahead and tried it. It works fine for me. Here's the complete code I used, could you point out what are you doing differently?
    Cheers,
    Greg
    create global temporary table abc_tab(col1 varchar2(10));
    create or replace procedure ins_abc_tab(v1 varchar2) as
    begin
    insert into abc_tab values(v1);
    end;
    using System;
    using System.Data;
    using System.Data.OracleClient;
    class Program
        static void Main(string[] args)
            OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger");
            con.Open();
            OracleTransaction txn = con.BeginTransaction();
            OracleCommand cmd = new OracleCommand("begin ins_abc_tab('foo');end;", con);
            cmd.Transaction = txn;
            cmd.ExecuteNonQuery();
            cmd.CommandText = "select * from abc_tab";
            OracleDataAdapter da = new OracleDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds);
            Console.WriteLine("rows found: {0}", ds.Tables[0].Rows.Count);
            // commit, cleanup, etc ommitted for clarity
    }

  • Java always returns 15 minutes greater than the current time.

    Hi,
    I am using Microsoft Windows Server 2003R2,Standard X64 edition with Service Pack 2 and jdk1.6.0-03.
    Java always returns time 15 minutes greater than the current system time.
    eg:
    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    System.out.println("Now time: "+simpleDateFormat.format(new Date()));
    System.out.println("Now time: "+new Date());The output of the program is :
    Now time: 2008-12-22 18:47:04
    Now time: Mon Dec 22 18:47:04 NPT 2008
    When my actual system time is 6:32 PM or (18:32)
    I have checked the current time with other programming languages like python and it always returns the actual date and time.
    Note: To my observation java is always utilizing a time which is 15 minutes greater than the current time even for its log.
    Thanks,
    Rajeswari (Msys)

    I think a more practical time machine would be one that actually travels back in time rather than forward (by 15 minutes). Sounds like it needs some more work.
    Anyway, I suggest changing the system time on your computer to some other value (say, 2 hours ahead), then running the program again. If its off by 2 hours and 15 minutes, its getting the time from your computer. However, if its still off by only 15 minutes (from your wristwatch's time), then its getting the time form somehere other than the computer clock.

  • APEX_UTIL.GET_PRINT_DOCUMENT always returning empty BLOB

    Dear community,
    I have a huge problem when using the function APEX_UTIL.GET_PRINT_DOCUMENT in a job or database procedure.
    The following code runs perfectly when I integrate it in the APEX application directly e.g. using a button to execute it (of course I use an anonymous PL/SQL block in APEX itself). But when I run the same code as a procedure or job in the APEX database itself I always receive a mail with an empty PDF:
    CREATE OR REPLACE PROCEDURE APEX_DRUG_SAFETY.CALL_MAIL
    is
    l_id number;
    l_document BLOB;
    BEGIN
    wwv_flow_api.set_security_group_id;
    l_document := APEX_UTIL.GET_PRINT_DOCUMENT
    +(+
    p_application_id=>'105',
    p_report_query_name=>'TestReport',
    p_report_layout_type=>'pdf',
    p_document_format=>'pdf'
    +);+
    l_id := APEX_MAIL.SEND
    +(+
    p_to        => '[email protected]',
    p_from      => '[email protected]',
    p_subj      => 'sending PDF via print API',
    p_body      => 'Please review the attachment.',
    p_body_html => 'Please review the attachment.'
    +);+
    APEX_MAIL.ADD_ATTACHMENT
    +(+
    p_mail_id    => l_id,
    p_attachment => l_document,
    p_filename   => 'mydocument.pdf',
    p_mime_type  => 'application/pdf'
    +);+
    wwv_flow_mail.push_queue(
    P_SMTP_HOSTNAME => 'DESMTP.TEST.COM',
    P_SMTP_PORTNO => '25');
    end;
    The problem is that the function APEX_UTIL.GET_PRINT_DOCUMENT always returns an empty BLOB when executed outside of the APEX application. I found this issue in several other posts in this forum but I did not find a solution.
    The mail transmission itself works perfectly. Also with an attachment if e.g. I use another BLOB already stored in the database for testing purposes. So it is not the mail transmission that causes the problem but the empty variable l_document that is still empty.
    Thanks in advance for the help.

    user9007075 wrote:
    Dear community,
    wwv_flow_api.set_security_group_id;
    you should be using this
        l_workspace_id := apex_util.find_security_group_id (p_workspace => 'YOUR_WORKSPACE_NAME');
        apex_util.set_security_group_id (p_security_group_id => l_workspace_id);
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_util.htm#AEAPI512

  • 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>

  • App store search always returns to  first page

    When I search the app store I am always returned to the 1st page after viewing an app description. This is very frustrating especially if there are hundreds of pages. Is there a way to get around this?

    I don't know if you noticed the small left-hand arrow head on the left-hand side of black menu bar?  It took me ages to notice this..

  • Bc4j:RowScope on a Master Detail page always returns 0 rows for detail

    Hi,
    I have a problem with a Master Detail page that is called from another page. The Master Detail page has two View Objects, Budgets and Budget Versions. These are linked properly in BC4J and when I use these VOs together I can navigate through the Budgets (master) and the Budget Versions (details) are populated correctly.
    However, I want to navigate to this page from another page which lists all possible Budgets. I pass the key of the selected Budget to the Master Detail page and the correct Budget is displayed, BUT the Budget Versions are NOT displayed - I get 0 rows returned.
    The mechanism I use to pass the selected Budget ID to my Master Detail page is:
    <ctrl:property name="key">
    <ctrl:selection name="ViewTable" key="key"/>
    </ctrl:property>
    My BC4J Registry is set up as follows:
    <bc4j:registryDef>
    <bc4j:rootAppModuleDef name="BudgetModule"
    defFullName="BudgetPackage.BudgetPackageModule"
    configName="BudgetPackageModuleLocal"
    releaseMode="stateful">
    <bc4j:viewObjectDef name="ItiBudgetsView1">
    <bc4j:rowDef name="CurrentBudgetRow" usesCurrency="True">
    <bc4j:propertyKey name="key"/>
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ItiBudgetVersionsView2" rangeSize="15"/>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    I then use
    <bc4j:rowScope name="CurrentBudgetRow">
    to get the correct Budget row in my master VO. But this always returns 0 rows in my detail VO. If I comment out the rowScope element, I don't get the desired Budget row, but I do get the correct Budget Version rows displayed. Is the rowScope element on the Budget VO interfering with the Budget Version VO?
    Hope this is not too confusing!!
    Thanks,
    Steve

    Steve,
    I tried to create a comparable set of two pages and initially ran into the same problem. I just realized that my issue (which I hope is yours too) is that the rootAppModule name was different across my two pages. This led to each page having its own application module instance, so the currency was different on each page.
    By changing all of my pages to use the same application module name (in the registryDef, in the appModuleScope tags in the page, and in the findAppModule tags in the handlers), I resolved this problem.
    My event handler to go to the master/detail page from the master page, FYI, looks like this:
      <event name="details" >
       <bc4j:findRootAppModule name="MyApp" >
        <!-- establish the ViewObject scope -->
        <bc4j:findViewObject name="CustomersView1" >
         <!-- find the selected Row -->
         <bc4j:findRowByKey>
          <bc4j:keyBinding>
           <bc4j:selectionKey name="viewTable" key="key" />
          </bc4j:keyBinding>
         </bc4j:findRowByKey>
        </bc4j:findViewObject>
        <bc4j:executeQuery />
        <go name="OrdersByCustomer_View" redirect="true" />
       </bc4j:findRootAppModule>                     
      </event>Hope this helps.
    -brian
    UIX Team

  • XML Validation : isschemavalid always returns 0

    Hello XML folks,
    I have registered the schema and tried to validate. It always returns 0 (i.e invalid).
    Could you please let me know what is wrong with XSD or XML
    Thanks,
    Parappa
    SQL> DECLARE
    2 doc varchar2(3800) :=
    3 '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    4 <!--W3C Schema generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    5 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:context="http://ibtco.com/common/exception/context" targetNamespace="http://ibtco.com/common/exception/context" elementFormDefault="qualified" attributeFormDefault="unqualified">
    6 <xs:simpleType name="ContextValueType">
    7 <xs:annotation>
    8 <xs:documentation>data types for properties</xs:documentation>
    9 </xs:annotation>
    10 <xs:restriction base="xs:string">
    11 <xs:enumeration value="boolean"/>
    12 <xs:enumeration value="char"/>
    13 <xs:enumeration value="byte"/>
    14 <xs:enumeration value="int"/>
    15 <xs:enumeration value="long"/>
    16 <xs:enumeration value="float"/>
    17 <xs:enumeration value="double"/>
    18 <xs:enumeration value="decimal"/>
    19 <xs:enumeration value="date"/>
    20 <xs:enumeration value="time"/>
    21 <xs:enumeration value="dateTime"/>
    22 <xs:enumeration value="string"/>
    23 </xs:restriction>
    24 </xs:simpleType>
    25 <xs:complexType name="ContextPropertyType">
    26 <xs:annotation>
    27 <xs:documentation>
    28 for holding name/value pair for application data
    29 </xs:documentation>
    30 </xs:annotation>
    31 <xs:simpleContent>
    32 <xs:extension base="xs:string">
    33 <xs:attribute name="Name" type="xs:Name" use="required"/>
    34 <xs:attribute name="Type" type="context:ContextValueType" use="optional"/>
    35 </xs:extension>
    36 </xs:simpleContent>
    37 </xs:complexType>
    38 <xs:complexType name="ExceptionContextType">
    39 <xs:annotation>
    40 <xs:documentation>
    41 for holding the data from applications
    42 </xs:documentation>
    43 </xs:annotation>
    44 <xs:sequence>
    45 <xs:element name="Property" type="context:ContextPropertyType" minOccurs="0" maxOccurs="unbounded"/>
    46 </xs:sequence>
    47 </xs:complexType>
    48 <xs:element name="ExceptionContext" type="context:ExceptionContextType">
    49 <xs:annotation>
    50 <xs:documentation>
    51 top level element exception context
    52 </xs:documentation>
    53 </xs:annotation>
    54 </xs:element>
    55 </xs:schema>';
    56 BEGIN
    57 dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/context', doc);
    58 END;
    59 /
    PL/SQL procedure successfully completed.
    SQL> DECLARE
    2
    3 l_errormsgid VARCHAR2(30);
    4 l_errorinfo VARCHAR2(100);
    5 l_error_context CLOB; -- Error Stack
    6 l_error_context_data CLOB; -- XML Context
    7 l_var_xml_context VARCHAR2(4000);
    8 l_var_error_stack VARCHAR2(4000);
    9 l_sqlCode UTL_ERROR_LOGS.ERROR_CODE%TYPE;
    10 p_ErrorMsgId NUMBER := '0';
    11 p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
    12 l_xml_context SYS.XMLTYPE;
    13 l_count number :=0;
    14 l_ret NUMBER;
    15 BEGIN
    16
    17
    18 -- Store XML in a clob
    19 /*
    20 l_var_xml_context := '<ExceptionContext>
    21 <Property Name="Name1" Type="boolean">true</Property>
    22 <Property Name="Name2" Type="string">String</Property>
    23 </ExceptionContext>';
    24 */
    25
    26 l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
    27 <!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    28 <ExceptionContext
    29 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    30 xsi:schemaLocation="http://ibtco.com/common/exception/context"
    31 >
    32 <Property Name="Name1" Type="boolean">true</Property>
    33 <Property Name="Name2" Type="string">String</Property>
    34 </ExceptionContext>';
    35
    36 DBMS_LOB.CREATETEMPORARY
    37 (
    38 lob_loc => l_error_context_data,
    39 cache => TRUE
    40 );
    41
    42 DBMS_LOB.WRITE
    43 (
    44 lob_loc =>l_error_context_data,
    45 amount => length(l_var_xml_context),
    46 offset => 1,
    47 buffer => l_var_xml_context
    48 );
    49
    50 l_xml_context := XMLTYPE(l_error_context_data);
    51
    52
    53 -- validate against XML schema
    54 --l_xml_context.schemavalidate();
    55 l_ret := l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
    56 IF l_ret = 1 then
    57 dbms_output.put_line('Data is valid:' || l_ret );
    58 ELSE
    59 dbms_output.put_line('Data is invalid:' || l_ret);
    60 END IF;
    61 END;
    62 /
    Data is invalid:0
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    Here is the script :
    DECLARE
    doc varchar2(3800) :=
    '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!--W3C Schema generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:context="http://ibtco.com/common/exception/context" targetNamespace="http://ibtco.com/common/exception/context" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:simpleType name="ContextValueType">
              <xs:annotation>
                   <xs:documentation>data types for properties</xs:documentation>
              </xs:annotation>
              <xs:restriction base="xs:string">
                   <xs:enumeration value="boolean"/>
                   <xs:enumeration value="char"/>
                   <xs:enumeration value="byte"/>
                   <xs:enumeration value="int"/>
                   <xs:enumeration value="long"/>
                   <xs:enumeration value="float"/>
                   <xs:enumeration value="double"/>
                   <xs:enumeration value="decimal"/>
                   <xs:enumeration value="date"/>
                   <xs:enumeration value="time"/>
                   <xs:enumeration value="dateTime"/>
                   <xs:enumeration value="string"/>
              </xs:restriction>
         </xs:simpleType>
         <xs:complexType name="ContextPropertyType">
              <xs:annotation>
                   <xs:documentation>
                        for holding name/value pair for application data
                   </xs:documentation>
              </xs:annotation>
              <xs:simpleContent>
                   <xs:extension base="xs:string">
                        <xs:attribute name="Name" type="xs:Name" use="required"/>
                        <xs:attribute name="Type" type="context:ContextValueType" use="optional"/>
                   </xs:extension>
              </xs:simpleContent>
         </xs:complexType>
         <xs:complexType name="ExceptionContextType">
              <xs:annotation>
                   <xs:documentation>
                        for holding the data from applications
                   </xs:documentation>
              </xs:annotation>
              <xs:sequence>
                   <xs:element name="Property" type="context:ContextPropertyType" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="ExceptionContext" type="context:ExceptionContextType">
              <xs:annotation>
                   <xs:documentation>
                        top level element exception context
                   </xs:documentation>
              </xs:annotation>
         </xs:element>
    </xs:schema>';
    BEGIN
    dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/context', doc);
    END;
    DECLARE
         l_errormsgid VARCHAR2(30);
         l_errorinfo VARCHAR2(100);
         l_error_context          CLOB; -- Error Stack
         l_error_context_data     CLOB;     -- XML Context
         l_var_xml_context     VARCHAR2(4000);
         l_var_error_stack     VARCHAR2(4000);
         l_sqlCode          UTL_ERROR_LOGS.ERROR_CODE%TYPE;
         p_ErrorMsgId NUMBER := '0';
         p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
         l_xml_context SYS.XMLTYPE;
         l_count number :=0;
    l_ret     NUMBER;
    BEGIN
         -- Store XML in a clob
         l_var_xml_context := '<ExceptionContext>
    <Property Name="Name1" Type="boolean">true</Property>
    <Property Name="Name2" Type="string">String</Property>
    </ExceptionContext>';
         l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
    <!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    <ExceptionContext
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ibtco.com/common/exception/context"
    >
    <Property Name="Name1" Type="boolean">true</Property>
    <Property Name="Name2" Type="string">String</Property>
    </ExceptionContext>';
         DBMS_LOB.CREATETEMPORARY
    lob_loc => l_error_context_data,
    cache => TRUE
         DBMS_LOB.WRITE
         lob_loc =>l_error_context_data,
         amount => length(l_var_xml_context),
         offset => 1,
         buffer => l_var_xml_context
         l_xml_context := XMLTYPE(l_error_context_data);
         -- validate against XML schema
         --l_xml_context.schemavalidate();
         l_ret := l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
         IF l_ret = 1 then
              dbms_output.put_line('Data is valid:' || l_ret );
         ELSE
              dbms_output.put_line('Data is invalid:' || l_ret);
         END IF;
    END;
    /

    problem was with the parameter you have passed as schema url.
    here is the modified code.
    problem was in this line.
    l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
    you have to pass the url as just a string without the double quotest (").
    now it returns 1.
    SQL> DECLARE
    2 l_var_xml_context VARCHAR2(4000);
    3 l_xml_context SYS.XMLTYPE;
    4 l_ret NUMBER;
    5 BEGIN
    6 l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
    7 <ExceptionContext xmlns="http://ibtco.com/common/exception/context" xmlns:xsi="http://www.w3.o
    rg/2001/XMLSchema-instance" xsi:schemaLocation="http://ibtco.com/common/exception/context
    8 http://ibtco.com/common/exception/context">
    9 <Property Name="Name1" Type="boolean">true</Property>
    10 <Property Name="Name2" Type="string">String</Property>
    11 </ExceptionContext>';
    12 l_xml_context := XMLTYPE(l_var_xml_context);
    13
    14 l_ret := l_xml_context.isschemavalid('http://ibtco.com/common/exception/context');
    15 IF l_ret = 1 then
    16 dbms_output.put_line('Data is valid:' || l_ret );
    17 ELSE
    18 dbms_output.put_line('Data is invalid:' || l_ret);
    19 END IF;
    20 END;
    21 /
    Data is valid:1

  • Execute oracle stored procedure from C# always returns null

    Hi,
    I'm trying to execute a stored procedure on oracle 9i. I'm using .Net OracleClient provider.
    Apparently, I can execute the stored procedure, but it always returns null as a result (actually all the sp's I have there returns null)! I can execute any text statement against the database successfully, and also I can execute the stored procedure using Toad.
    This is not the first time for me to call an oracle stored procedure, but this really is giving me a hard time! Can anyone help please?
    Below are the SP, and the code used from .Net to call it, if that can help.
    Oracle SP:
    CREATE OR REPLACE PROCEDURE APIECARE.CHECK_EXISTENCE(l_number IN NUMBER) AS
    v_status VARCHAR2(5) := NULL;
    BEGIN
    BEGIN
    SELECT CHECK_NO_EXISTENCE(to_char(l_number))
    INTO v_status
    FROM DUAL;
    EXCEPTION WHEN OTHERS THEN
    v_status := NULL;
    END;
    DBMS_OUTPUT.PUT_LINE(v_status);
    END CHECK_CONTRNO_EXISTENCE;
    C# Code:
    string connStr = "Data Source=datasource;Persist Security Info=True;User ID=user;Password=pass;Unicode=True";
    OracleConnection conn = new OracleConnection(connStr);
    OracleParameter param1 = new OracleParameter();
    param1.ParameterName = "v_status";
    param1.OracleType = OracleType.VarChar;
    param1.Size = 5;
    param1.Direction = ParameterDirection.Input;
    OracleParameter param2 = new OracleParameter();
    param2.ParameterName = "l_number";
    param2.OracleType = OracleType.Number;
    param2.Direction = ParameterDirection.Input;
    param2.Value = 006550249;
    OracleParameter[] oraParams = new OracleParameter[] { param1, param2 };
    OracleCommand cmd = new OracleCommand("CHECK_EXISTENCE", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddRange(oraParams);
    conn.Open();
    object result = cmd.ExecuteScalar();
    conn.Close();

    Hi,
    Does that actually execute? You're passing two parameters to a procedure that only takews 1 and get no error?
    Your stored procedure doesnt return anything and has no output parameters, what are you expecting to be returned exactly?
    If you're trying to access V_STATUS you'll need to declare that as either an output parameter of the procedure, or return value of the function, and also access it via accessing Param.Value, not as the result of ExecuteScalar.
    See if this helps.
    Cheers,
    Greg
    create or replace function myfunc(myinvar in varchar2, myoutvar out varchar2) return varchar2
    is
    retval varchar2(50);
    begin
    myoutvar := myinvar;
    retval := 'the return value';
    return retval;
    end;
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    public class odpfuncparams
         public static void Main()
          OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl");
          con.Open();
          OracleCommand cmd = new OracleCommand("myfunc", con);
          cmd.CommandType = CommandType.StoredProcedure;
          OracleParameter retval = new OracleParameter("retval",OracleDbType.Varchar2,50);
          retval.Direction = ParameterDirection.ReturnValue;
          cmd.Parameters.Add(retval);
          OracleParameter inval = new OracleParameter("inval",OracleDbType.Varchar2);
          inval.Direction = ParameterDirection.Input; 
          inval.Value="hello world";
          cmd.Parameters.Add(inval);
          OracleParameter outval = new OracleParameter("outval",OracleDbType.Varchar2,50);
          outval.Direction = ParameterDirection.Output;
          cmd.Parameters.Add(outval);
          cmd.ExecuteNonQuery();
          Console.WriteLine("return value is {0}, out value is {1}",retval.Value,outval.Value);
          con.Close();
    }

  • Select query on table rcv_lots_interface is always returning null

    Hi ,
    I need a help on the below issue.
    The issue is after creating PO in Oracle 11i I receive it in MSCA application.
    When we receive it at that point data gets inserted in the table " rcv_transactions_interface " and we have written a trigger on it.
    From the trigger on table " rcv_transactions_interface " we are calling a package and in the package we have select query on "rcv_lots_interface."
    But the select query is always returning null even though we are passing the correct "interface_transaction_id " and also after the "Receiving Transaction Processor" is executed i can see data in the table " RCV_LOT_TRANSACTIONS " for the same transaction.
    Below is the sample code i am using.
    CREATE OR REPLACE TRIGGER inv.RCV_TRAN_TRIGGER
    AFTER UPDATE
    ON po.rcv_transactions_interface
    FOR EACH ROW
    WHEN (NEW.processing_status_code='PENDING'
    AND NEW.destination_type_code IN ('INVENTORY','RECEIVING')
    AND NEW.mobile_txn = 'Y')
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    v_user_id NUMBER;
    v_interface_transaction_id NUMBER;
    v_organization_id NUMBER;
    v_item_id NUMBER;
    v_quantity NUMBER;
    v_resp_id NUMBER;
    v_mobile_txn VARCHAR2(5);
    v_shipment_header_id NUMBER;
    v_bill_of_lading VARCHAR2(100);
    v_group_id NUMBER;
    v_header_interface_id NUMBER;
    BEGIN
    v_interface_transaction_id := :NEW.interface_transaction_id;
    v_organization_id := :NEW.to_organization_id;
    v_user_id := :NEW.created_by;
    v_item_id := :NEW.item_id;
    v_quantity := :NEW.quantity;
    v_resp_id :=fnd_profile.VALUE('RESP_ID');
    v_transaction_type := :NEW.transaction_type;
    v_mobile_txn := :NEW.mobile_txn;
    v_bill_of_lading := :NEW.bill_of_lading;
    v_group_id := :NEW.group_id;
    v_header_interface_id := :NEW.HEADER_INTERFACE_ID;
    INV.INV_RCV_TRX_PKG.INV_RCV_LABEL_GEN_PRC( v_user_id,
    v_interface_transaction_id,
    v_item_id,
    v_quantity,
    v_organization_id,
    v_resp_id,
    v_shipment_header_id,
    v_bill_of_lading,
    v_header_interface_id,
    v_group_id);
    END;
    CREATE OR REPLACE PACKAGE BODY INV.INV_RCV_TRX_PKG
    AS
    PROCEDURE INV_RCV_LABEL_GEN_PRC( p_user_id IN NUMBER,
    p_interface_transaction_id IN NUMBER,
    p_item_id IN NUMBER,
    p_quantity IN NUMBER,
    p_organization_id IN NUMBER,
    p_resp_id IN NUMBER,
    p_shipment_header_id IN NUMBER,
    p_bill_of_lading IN VARCHAR2,
    p_header_interface_id IN NUMBER ,
    p_group_id IN NUMBER
    IS
    v_user_id NUMBER;
    v_print BOOLEAN;
    v_resp_id NUMBER;
    v_resp_appl_id NUMBER;
    v_lot_num VARCHAR2(50);
    BEGIN
    BEGIN
    SELECT application_id
    INTO v_resp_appl_id
    FROM apps.fnd_responsibility_tl frt
    WHERE responsibility_id=p_resp_id;
    END;
    apps.fnd_global.apps_initialize(p_user_id, p_resp_id, v_resp_appl_id);
    BEGIN
    SELECT rli.lot_num , rli.expiration_date
    INTO v_lot_num ,
    v_expiration_date
    FROM apps.rcv_lots_interface rli
    WHERE rli.interface_transaction_id = p_interface_transaction_id ;
    EXCEPTION
    WHEN OTHERS THEN
    v_lot_num :=NULL;
    v_expiration_date :=NULL;
    apps.fnd_file.put_line(fnd_file.log,'Exception while deriving LOT Number ######### '||p_interface_transaction_id||'------'||SQLERRM);
    END;
    END;
    Need your help to understand why the below query is always returning null and what is the solution for it ?
    SELECT rli.lot_num , rli.expiration_date
    FROM apps.rcv_lots_interface rli
    WHERE rli.interface_transaction_id = p_interface_transaction_id ;
    Thanks
    Jaydeep
    Edited by: user10454886 on Mar 25, 2013 6:31 AM
    Hi ,
    I need a solution to this issue at the earliest.
    Appreciate all of your help
    Thanks
    Jaydeep

    Centinul wrote:
    There are a lot of bugs listed in Metalink with respect to wrong results and function-based indexes.
    Here are a few:
    Bug 4028186 Wrong results if function based index exists
    Bug 4717546 Wrong results / poor plan when function based index exists
    Bug 5092688 Wrong results if function based index exists
    Based on reviewing them the workarounds range from dropping the index to setting "_disable_function_based_index" to TRUE.Facinating. It seems to me that if you use the undocumented intitialization parameter you might just as well drop the FBIs too.
    Another hazard of FBIs is the Law of Unintended Consequences. 2 years ago we tried to use one to speed up a query in a PL/SQL package. Worked OK for that purpose, but an unrelated loader on the affected table ran and rand but never finished until the FBI was dropped.

  • Cascading LOV always returns first row in af:query

    HI
    JDEV 11.1.1.3.0
    A strange thing is happening with my cascading LOV which is input text with LOV.
    I have a read only table with a query section. I then also bring up any of the tables rows in a popup with single record view where the row is then in an af:form for inserting and updating.
    Both the af:query and af:form have the cascaing LOV in them.
    When testing the cascading LOV in the BC Browser it works fine. When I use it in the popup in the af:form record it works fine. But in the af:query section, no matter which row I choose in the LOV, it always returns the 1st row of the LOV back to my input text component.
    Has anyone experienced this...any ideas?
    Thanks,
    Mario

    Aha...and the above log message lead me to the solution!! :-)
    The VO is based on an Oracle data dictionary view, DBA_TAB_COLUMNS. When you create the read only VO, by default it does not create any of the attributes as "key" attributes, because the oracle view has no primary key.
    Setting owner, tableName and columnName as key attributes solved this issue, now my cascading LOV works in the BC Tester, af:query component and my af:form component.
    Regards,
    Mario

  • Field Number(19,8) always returns Zero!

    Thanks for reading this
    I am developing an application in VB6 on
    NT 4 SP5 and have come accross a very strange
    error. This project is a migration from
    Sequel Server, I am redoing an ACCESS application.
    In one of the tables, the Latitude and Longitude is stored as of Type Number(19,8)
    (don't ask why - I didn't design the tables).
    All of the data is being retrieved through disconnected ADO recordsets. The data is being written with ADO connection SQL statements.
    Writing of the values through the Oracle ODBC driver seems to work properly (8.01.05 - 02/02/99). When I read the values through a ADO Recordset query, the latitude and longitude always returns 0 (when they are not null).
    I tried switching to the Microsoft ODBC Driver for Oracle, and that driver works fine. The latitude and longitude are correct.
    I can view the data fine through SQL Plus or
    ACCESS via linked Tables, so the data is OK.
    Thanks
    John
    null

    And what does this have to do with JDBC?
    There was a bug in one of the earlier 8.x Oracle ODBC drivers that woukld cause this behavior. Get the latest patch version of the driver frorm Oracle support and you will be fine.

Maybe you are looking for