Using only one method in session bean to create web service

Hi all,
I hhave a scenario where i am inserting and retrieving data from dict table using web service.
For this i have created a session bean and a wrapper class.
The session bean has two methods: insertRecords(), and viewRec().
so while creating a web service i need to include two methods.
I want to have only one method where i can pass a parameter as operation and if it is "I", then i can call the insert method and if it is "S" i can call view method.
I tried doing that bt i am stuck up with the return type.
Insert method has return type as array of wrapper class and
view method has wrapper class as return type ...
Is this scenario possible..??
or is there any other way to do this???
Plz let me knw..
Thankls n regards,
Ankita

Hi Siddharth,
Im really sorry..
i cudnt  get u ..
Actually these r methods:
public DemoDicModel[] viewRecords()
and
public DemoDicModel insertRecords(
          String title,
          String desc,
          String status)
and im trying this:
public DemoDicModel[] getMethods(String operation,String title,String desc, String st)
DemoDicModel[] demoModel =null;
DemoDicModel model = new DemoDicModel();
if(operation == "show")
      demoModel = viewRecords();
if(operation == "ins")
      model = insertRecords(title,desc,st);
      model.setMsg("RECORDS GENERATED");
      demoModel=
return demoModel;
im stuck up with insert operation.
can  u plz explain me in detail.
thanks,
ankita

Similar Messages

  • MDM Session Exception While Creating Web Services

    Hi all i am creating webservices over a java class. My Java class connects with MDM and fethes the data. When I am running my java class it is able to fetch the values from MDM but when i am exposing this method to web services I am getting request same as my method but the I am not getting any response, What i am getting is                                                                                "An error has occurred. Maybe the request is not accepted by the server:
    com/sap/mdm/session/MdmSessionContext" .  Also the response is
    HTTP/1.1 500 Internal Server Error
    Connection: close
    Server: SAP J2EE Engine/7.00
    Content-Type: text/xml; charset=UTF-8
    Date: Thu, 24 Sep 2009 17:04:02 GMT
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>com/sap/mdm/session/MdmSessionContext</faultstring><detail><ns1:java.lang.NoClassDefFoundError xmlns:ns1='http://sap-j2ee-engine/error'>com/sap/mdm/session/MdmSessionContext</ns1:java.lang.NoClassDefFoundError></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

    Hi,
    It looks like when you are running webservice it is not able to find some reference classes you might have missed to include one or more jar files while deploying the web service on server thats might be the  reason as when you are running Java class it is working fine.
    please follow below process and check if anything is missing.
    Right click on project -> Properties -> Java Build Path
    at this place you can see the reference projects and jar files in different tabs
    go to tab Order & Export and see if the desired jar file is selected or not if not select it and deploy the application again.
    Ninad

  • Plz help!! idempotent methods stateful session beans? (failover)

              plz help!! idempotent methods stateful session beans? (failover)
              Hi there,
              Im trying to failover my shopping cart implemented using stateful ejb, the replication
              is working but the failover is not (Object not found exception....).
              By design is hard to think on an stateful ejb using idempotent methods, but after
              checking the documentation in detail im completely confused, so im starting to
              wonder if i should use idempotent methods or manual retry in case one server is
              down.
              Plz take a loo at these explanations about faiolver in the WLS edocs.
              "....With clustered objects, automatic failover generally occurs only in cases
              where the object is idempotent.....Because of this, replica-aware stubs will not,
              by default, attempt to retry a method that fails after the request is sent but
              before it returns. This behavior can be overridden by marking a service idempotent..."
              BUT
              "By default, a stateful session bean's Home stub provides load balancing and failover
              for its method invocations to any clustered server where the bean is deployed...."
              So is possible to achieve automatic failover (not only load balancing) for stateful
              ejb without having to worry about state-changes or manual retry. (i know the retry
              is requiered if the server crashed just before finishing a transaction but this
              is not what im talking about).
              Any help will be highly appreciated
              Alan
              

              Ryan,
              Yes, im deploying using In-memory replication and clusterable elements, when try
              to invoke the method (after one of the nodes is down) i recieve an "java.rmi.NoSuchObjectException:
              Bean has been deleted".
              I believe all this could be related to some sort of issue with JNDI Lookup in
              the cluster, but haavent been able to get a clue to make it work....(almost desesperate
              by now)
              Alan
              "ryan upton" <[email protected]> wrote:
              >Alan,
              >
              >If the state isn't maintained during failover I would suspect a
              >configuration error. Have you set the <replication-type> element within
              ><stateful-session-clustering> tag in the bean's deployment descriptor?
              >
              >"Alan" <[email protected]> wrote in message
              >news:40e17cf7$1@mktnews1...
              >>
              >> Ryan,
              >>
              >>
              >> Maybe i didnt explain myself, in the scenario im dealing with I KNOW
              >the
              >method
              >> finished succesfully (example, the user succesfully added an item to
              >a
              >cart).
              >>
              >>
              >> Just after that one of the nodes goes down, and the user decides to
              >add a
              >new
              >> item (new invocation , not a retry of failed one) on the same session.
              >>
              >> This is the case in which failover should work automatically as you
              >say,
              >meaning
              >> the new method invokation should be able to retrieve the session state
              >info from
              >> the replica and switch the primary.....Well, this is the part wich
              >isnt
              >working
              >> :( as i understand it should transparently
              >>
              >> I believe could be a config issue , but have no way to make it work.
              >>
              >> Regards,
              >>
              >> Alan
              >> "ryan upton" <[email protected]> wrote:
              >> >
              >> >"Alan" <[email protected]> wrote in message
              >news:40e06296@mktnews1...
              >> >>
              >> >> Ryan,
              >> >>
              >> >> Thanks for clearing the both conditions a bit more, in this case
              >my
              >> >issue
              >> >has
              >> >> to do with the scenario #1 in which subsequent calls (invocations)
              >> >go to a
              >> >node
              >> >> which isnt avaliable(down), do you have any idea of in what conditions
              >> >the
              >> >"automnatic"
              >> >> failover would fail??? (meaning why the stub would try to dispatch
              >> >a call
              >> >to the
              >> >> same previous node)
              >> >>
              >> >> Thanks for the help again
              >> >>
              >> >
              >> >Subsequent calls won't go to a node that's down. That's the whole
              >> >point
              >> >;-). Failover is always automatic, what you are getting confused
              >on
              >> >is
              >> >automatic method re-execution upon failover which happens if the method
              >> >has
              >> >been marked as idempotent. The logic is this: if I failover to an
              >EJB
              >> >that
              >> >I know is still alive, I can't safely call the same method again.
              > Why?
              >> >Because I don't know how much of the method completed the last time
              >before
              >> >the previous bean's failure. So if the bean can yield multiple results
              >> >from
              >> >multiple invocations I had better play it safe and not re-execute
              >the
              >> >method
              >> >on the bean I failed over to (unless it's idempotent because in that
              >> >case it
              >> >doesn't matter how many times I call it, it always does the same thing).
              >> > In
              >> >scenario #1 and #2 failover is automatic and all new calls are executed
              >> >against the bean the client failed over to, but only idempotent methods
              >> >are
              >> >re-executed.
              >> >
              >> >
              >>
              >
              >
              

  • HeuristicHazard within a transaction using only one DataSource

    We have an ejb 2.0 application running under WL 7.0 SP1. Its CMP beans are
              persisted in two Oracle 9i databases, some beans from different databases
              are related (have CMR). We are using XA Oracle JDriver for both pools.
              The javax.transaction.HeuristicMixedException exception occurred when the
              client application called getId() method on the local interface of one of
              the beans. The client is a webapp deployed together with the ejbs in the one
              EAR.
              The mentioned bean doesn't have any CMR with any bean from the other
              database, and its transaction attribute is 'Required'. Therefore method call
              which resulted in HeuristicMixedException was using only one DataSource. Why
              did exception happened?
              

    No.
    There is a very slight increase in performance if you have two chips of the same size, but it is something that will only really show up in benchmarks.
    Get 1GB now and leave the other 256MB chip in there. When you have an extra $80 around doing nothing, grab another stick.

  • Persisting Multiple Entries using only one form

    Hi Everyone,
    I have a form on which I am entering phone number and city.
    The form prompts the user to enter 3 phone numbers and 3 cities.
    My java bean is Address which have two fields phone and city.
    How can I bind the Java bean with form so that after submission of form three entries will go in Address table.
    Thanks
    Ambrish

    I already have Address bean but how to use it so that two records will enter using only one form.

  • How to query on a single row form using only one page

    Hi APEX experts, I am just a beginner in apex and I face several problems on development. Despite that the forum helps me a lot and your answers to other people are valuable , I have stacked into something. Could you please someone tell me : if there is a way to define a single row form page based on table in which I could query and update without using a tabular page (to call the single row form). I want only to use only one page. Does APEX has this functionality? Thank you very much?

    I haven't tried it, but I am going to guess that yes it's possible (or if I were going to do this, this is what I'd try and I suspect it will work).
    If you take a moment and step back and look at what the wizard does when building a "form on a table with report", all it does is build two pages with page 1 (report overview with drill-down Edit button or link usually) calling page 2 (form) and setting the PK field on the page 2 form with an automated row fetch process and built-in DML processes. It's not that hard.
    Page 2 really doesn't care what the calling page was in order to query a single row; it just cares that ANY caller sets the primary key value for the ARF process to fetch a row. So I would just make page 2 call itself. This is what I'd do (and you might have to fine-tune little things that I might not have forseen but I think this will work).
    For the sake of example, let's say our table is PARTS and in it is a PART_ID, PART_NUMBER, PART_DESCRIPTION, PART_COST, etc. Assume PART_ID is the primary key and sequentially assigned by the DB in a trigger and is functionally meaningless to the user and is for PK purposes only. Let's assume PART_NUMBER is a unique key (although not the PK) by which the user will "know" a unique row (since the PK of PART_ID is more internal and not meaningful to the user). Assume PART_DESCRIPTION, PART_COST, etc. are just attributes.
    1. Use the wizard and build a "form on a table with report". This is just to get the handy dandy ARF process and DML processes, validations, etc. all generated for you. Let's assume the report page is Page 1 and the form is Page 2.
    2. When done, delete the report page entirely (so delete page 1).
    3. Edit the form page (page 2) and change any branch references from the nonexistent page 1 to now be page 2.
    Now here's the part where something has to set the internal P2_PART_ID field when page 2 is run. So why not set it from itself from something the user will uniquely enter?
    4. Create a P2_PART_NUMBER_FETCH item (text item is fine or if you want a LOV or whatever that's good too....whatever works. For clarity, you might even want to create a separate "search" or "query" region separate and above your existing form region to set this field apart visually so users know it's a search field. Source for this field should be "only when current value in session state is null".
    5. Created some sort of "GO" button to go along with the P2_PART_NUMBER_FETCH field.
    6. Make sure none of your existing post-submit processes fire when GO is pressed (edit all of the computations and validations and processes and ensure that they have conditions such that they do not fire when the submit value is "GO", so like a PL/SQL expression and set to v('REQUEST')<> 'GO').
    7. Add a new validation to your page that only fires when GO is pressed. Have it validate only when GO is pressed. Have it validate that P2_PART_NUMBER_FETCH is not null.
    8. Add a new PL/SQL process to your post-submit processing that only fires when GO is pressed. Have it look up to the database based on P2_PART_NUMBER_FETCH and get the PART_ID that corresponds to the part number the user entered and set the part number, something like this (even better for style and reusability if you embed this in a DB package function and call it):
    SELECT part_id
    INTO :P2_PART_ID
    FROM PARTS
    WHERE PART_NUMBER = :P2_PART_NUMBER_FETCH;
    9. Not sure if the branches that were generated will suffice for this (might need to add a new one...review what you have and see) but the bottom line is that the page should branch to itself (page 2) and not clear the cache.
    10. When the page repaints, since :P2_PART_ID is now populated in session state (again, page 2 should not care how it got populated...only should care that it did get populated by anything (including itself)), the automated row fetch (ARF) should fire and query up the row from the database for editing.

  • HT204053 i RECENTLY PURCHASED ANOTHER IPHONE.  MY INTERNET IS NOT WORKING.  I JUST CREATED AN APPLE ID.  WHAT'S NEXT?  I NOW HAVE TWO DIFFERENT ACCOUNTS WITH DIFFERENT USER NAMES.  HOW CAN I USE ONLY ONE ACCOUNT FOR ITUNES, ICLOUD APPLE ID ETC???

    I RECENTLY PURCHASED ANOTHER IPHONE.  MY INTERNET IS NOT WORKING.  I JUST CREATED AN APPLE ID.  WHAT'S NEXT?  I NOW HAVE TWO DIFFERENT ACCOUNTS WITH DIFFERENT USER NAMES.  HOW CAN I USE ONLY ONE ACCOUNT FOR ITUNES, ICLOUD APPLE ID ETC???

    Welcome to the Apple community.
    iTunes and iCloud and different accounts, you will need to delete both accounts from your device before adding the new details in their place.
    For iCloud go to settings > iCloud, scroll down and hit the delete button. You can then sign back in using your correct details. For iTunes go to settings >store, tap your account ID and then sign out, you can then sign back in using your correct Apple ID.

  • Hi,  If I have 1 license for creative cloud, will it possible to install in 2 computers (1 laptop and 1 desktop)?  When I am in the office I can use desktop and at home I can use laptop? At the same time I will be using only one devise. Will that be possi

    Hi,  If I have 1 license for creative cloud, will it possible to install in 2 computers (1 laptop and 1 desktop)?  When I am in the office I can use desktop and at home I can use laptop? At the same time I will be using only one devise. Will that be possible?  Thanks

    Yes. Yes. Yes.
    Mylenium

  • Need to use only one sender and receiver communication channel.

    Hello Experts.
    I have a scenario where in I have to use only one sender and receiver communication channel to push files from different source directories to different receiver directories.
    For Eg;
    Sender                              
    D://dir1/file1 --->                  E://dir1/File1
    F://dir2/file2 ---->                 G://dir2/file2
    H://dir3/file3----->                 I://dir3/file3.
    Can this be achieved by using pass through scenario?
    Please let me know if the requirement is not clear.     
    Thanks in advance.
    Advit Ramesh

    Hi Advit,
    I think it is possible. You have to use the Advanced Selection for Source file in the sender channel to define multiple files to be picked up. Also, the Dynamic configuration must also be enabled and used in the mapping so you can manipulate the target directory and target file name based on your source files.
    For Polling from multiple directories:
    http://wiki.scn.sap.com/wiki/display/XI/File+Sender+Adapter+-+Polling+Multiple+Directories
    Dynamic Configuration:
    Dynamic file name and directory in Receiver File Adapter - summary of possibilities - Process Integration - SCN Wiki

  • I am using only one Apple ID. The problem, since iOS 6,  is the App Store purchased items screen just shows loading screen  it finally crashes or gives the error message 'can not connect to  Apple store'

    I am using only one Apple ID. The problem, since iOS 6,  is the App Store purchased items screen just shows loading screen  it finally crashes or gives the error message 'can not connect to  Apple store'

    I am using only one Apple ID. The problem, since iOS 6,  is the App Store purchased items screen just shows loading screen  it finally crashes or gives the error message 'can not connect to  Apple store'

  • How do you use only one plugin in Logic for multiple guitar tracks? I want to only use one instance of Pod Farm and run all my guitar tracks through that one instance.

    I want to be able to use only one instance of Pod Farm for my guitars, and have all of my guitar tracks run through it while I'm recording.

    What he said. Or here is a similar approach with a picture.
    1. Press the SEND button on every stereo (or mono) guitar track you want to send through the effect. Then select a free bus.
    2. Make sure you turn up the amount of send (in db). Holding alt while leftclicking on this circle sets the send level to 0 db wich is good.
    3. Open the mixer (Cmd+2). Please see that I here have turned the output off from the stereo guitar track. That way the only output will be the BUS, in your case the AmpTrack bus where all your guitars will pass through. If you want both the original guitar sound AND the Ampfarm effect then just set all outputs on your guitar tracks to Stereo Out, like the AmpF Bus track is set in my picture.
    4. Insert your AmpFarm plugin here. I don´t have that plug so I inserted Waves Renes Axe for demo purpose.
    Adjust the volume/effect of every guitartrack by turning the circle input shown as 2. in my picture.
    I now see that you mentioned Pod Farm, not AmpFarm. But I guess it´s the same trick.
    Have fun.
    Heyclown.
    Message was edited by: WizardSongs - Typhoos

  • Multiple Qaawses but use only one Qaaws at a time

    Hi,
    In Dashboard , I have two Qaawses (Qaaws1 and Qaaws2). When I am trying to generate SWF file both the qaawses are running. My requirement is, in Excel file I will set a flag value in one cell (0/1).
    If the cell value is '0' then the Dashboard should use only Qaaws1.
    If the cell value is '1' then the Dashboard should use only Qaaws2.
    In essence my requirement is, even though multiple Qaawses are present in Dashboard, the Dashboard should be able to use only one Qaaws at a time based on my requirement (i.e., based on flag bit value 0/1).
    Can any one suggest,  solution for this?
    Thanks in advance.
    Regards,
    M. N. Kishore Babu.

    Hi David,
    Thank you very much for the response and sorry for the delay.
    Our actual scenario is a s follows:
    We pass customer id and shipper Group Id as an input parameters to the flash variables from front end (through Java program). And these two values will written in Excel cells (let say Customer id in A1, and Shipper Group Id in B1)
    Now there are two Qaawses, Qaaws1 and Qaaws2 in the xlf in addition to flash variables.
    Qaaws 1 query is as follows :
    select * from shp_details where customer id = A1
    Qaaws 2 query is as follows :
    select * from shp_details where customer id = A1 and ShipperGroup_id = B1
    On front end we have two drop downs, Dropdown1  is for customer id and Dropdown2 is for Shipper Group Id.
    When we select an item in Dropdown1, from front end we pass only Customer Id and when we select an item in Dropdown2, we pass both Customer Id and Shipper Group Id.
    Our requirement is,
    When we select Dropdown1 (we are passing only customer id), we expect only Qaaws1 to be executed.
    When we select Dropdown2 (we are passing  both customer id and shipper Group Id), we expect only Qaaws2 to be executed.
    Please let me know, if I need to provide any further clarification.
    Thanks & Regards,
    M. N. Kishore Babu.

  • Parallelism in oracle using only one dual-core processor

    Hi, is usefull or could i use parallel execution in oracle using only one dual core processor?
    Can someone explain me why?

    Hi
    To take advantage of parallel processing you need enough resources (mainly CPU and I/O). If you run serially and the bottleneck is the CPU, then parallel processing might help. On the contrary, if the bottleneck is located in the I/O sub-system, throwing more CPU to it would not make things better. So, it's a question of balance between the CPU and I/O resources you have.
    HTH
    Chris

  • Is third-party SO/PO  process possible using only one company code?

    Hi friend,
    1) my client wants to implement third-party PO process but also wants a way of keeping track of inventory during this process. I know that inventory should be tracked on the vendor side and not on our client side since we're doing third-party PO.
    However my client wants to track inventory (in an inventory g/l account like 120100) so that when my client post a Goods Receipt, the inventory account
    gets Debited and when client post  the outgoing invoice to customer, the inventory account gets Credited. In this way, my client can track
    if the customer have received the ordered item or not.
    The problem is that third-party PO posts to consumption account but DOES NOT post to inventory account. Is there any way of
    setting this up so that in addition to posting to comsumption account every time a Goods Receipt occurs?
    2) i tried to create "Individual Purchase Order" (customer order from client -> client order from
    vendor -> vendor ships item to client -> client then ships item to customer) so that posting will hit inventory account.
    However, i find that taking this approach involves setting up a Plant for vendor (A), a Plant for our Client (B), and a Plant for Customer (C).
    Because when i do a Goods Receipt, the stock has move from Plant A to Plant B. Then when i do a Goods Issue to the customer, it asks for the receiving plant. I assume this means that the stock moves from Plant B to Plant C.  
    Also, from the reading i did on the forum, i get the impression that i need to create more than one Company Code if i were to do
    third-party PO.  Do the Vendors have to be created in a different company code then the Customer? Or does it mean that Just the
    plant (like Plant A) needs to be created in a different Company Code then Plant B and Plant C?
    3) can i do third-party PO using only ONE company code?
    Can anyone provide some clarification on this issue? I've read tons of posting but none really helped clear  this issue up.
    Thanks so much.

    Dear Kishore,
    Individual PO processing is not third party process at all. In third party process the vendor delivers the goods dirctly to the customer - please check what SAP help says.
    http://help.sap.com/saphelp_46c/helpdata/en/dd/5601d4545a11d1a7020000e829fd11/content.htm
    Dear Queyen,
    One important point of third party process is that there's no need to keep stock of materials - that is in harmony with reality. Why does your customer want to keep stock from the goods if they doesn't receive at all? Is it coreect? It doesn't correspond to the fact.
    You can do statistical (ghost) GR against the third-party PO and you can see the goods movement in MB51 - I think this should be enough.
    http://help.sap.com/saphelp_46c/helpdata/en/dd/560287545a11d1a7020000e829fd11/frameset.htm
    BR
    Csaba

  • Hi! At connection to iTunes the section "other" constantly increases. What's the matter? How to avoid it? On phone music isn't necessary, video too isn't present. But another grows. How to correct it? I know only one method, it to dump all settings and a

    Hi! At connection to iTunes the section "other" constantly increases. What's the matter? How to avoid it? On phone music isn't necessary, video too isn't present. But another grows. How to correct it? I know only one method, it to dump all settings and a content.

    http://discussions.apple.com/docs/DOC-5142

Maybe you are looking for

  • Report for Reconciliation of serial number -Need Table help

    Hi all, I am working on Report to get info on "Reconciliation of serial number" The business flow is as below: (Transaction MIGO) 1.     Receipt of Gas Cylinder u2013 (Mvt type  501M) 2.     Transfer Cylinder to Production dept.- (Mvt type  311M) 3. 

  • My Mac Pro display setup for photography

    I am a photographer and a recent refugee from Windows. I'm using my new Mac Pro to manage and process about 100K images and other digital assets. I'm especially pleased with my system's display configuration. Here is what I've got: I'm driving my dis

  • Purchase Order required at PGI Level in the delivery

    Dear Gurus, I am having the following problem: When I want to make Post Goods Issue at delivery level (VL01), the system prompts me for a Purchase Order Number. I have updated the stock in 2009 and I have checked that there are sufficient quantities

  • Using functions in default-field in wizzards

    Hi there, I tried to build a table in the database section of the portal with the primary key being a 'number'. Into the default-field I put the statement: SELECT <owner>.<sequence>.NEXTVAL FROM DUAL (the sequence I had defined before). This statemen

  • Automatic insertion of new record.....help......

    i have done insertion of 6 field in the database..which is working good(code is below)...Now i want to do stuff that when i insert 6 field in database, then a new record also has to be insert into the database, in that new record the following change