Design of application service

Hello CAF Experts,
I created a CAF business object with some entity service. Now I would like to create an application service on top of that. The question is how should this be designed.
Is there a way to call CAF entity service directly from the new application service. If so, has anybody a coding example?
Or is it the better way to import the entity services as external webservices and access them from the new application service? Also here I would appreciate a little coding example.
Thanks,
Michael

hi,
For Business Objects:
You have created the Business Objects all ready.
Now, Create an application service. Add your Business Objects as dependency to the application service so that you can access these business objects in the application service.
For example, Travel is a Business Object. TravelAS is an application service. Now add Travel as a dependency to the TravelAS. In the TrvelAS, You can access Travel using the following code.
List<Travel> travelList = this.getTravelService().findByStartLocation(
                    startLocationQF);
[Creating application service.|http://help.sap.com/saphelp_nwce711/helpdata/en/45/173644c24026cae10000000a11466f/content.htm]
For external services:
First you import the external saervice(Web service/ RFC) in to your project. Then create application service and do default mapping between your imported external service and this application service. The application service acts as a wrapper for the external service.
[Architectural Guidelines for Business Logic|http://help.sap.com/saphelp_nwce711/helpdata/en/45/173644c24026cae10000000a11466f/content.htm]
Thanks

Similar Messages

  • Web Dynpro and CAF (BOs, Application Services, returning Complex Types)

    Hi All,
    I am trying to develop an application using Web Dynpro and CAF for days now and did not get it running.. I need some help here.
    What I am trying to do / have done is the following:
    - Design a Business Object (BO) in CAF
    - Implement an Application Service that has a method called getAllBOs that calls the findAll method of the BO
    - call this method using AWS model or EJB model in Web Dnypro, show the result in a table.
    My getAllBOs returns a set of BOs (Data Type is the Complex Type of my BO in CAF). I was able to design the Application Service so that it returns a collection of BOs (using a Wrapper Comple Type), but I was never able to call the generated Web Service successfully in Web Dynpro. The WebService worked fine when testing it in wsnavigator...
    However, i never got it running.. is there anybody out there who is able to explain what to do to import a AWS model or an EJB model in Werb Dynpro and particularily how to implement the stuff so that it returns a set of BOs successfully...
    Thanks in advance.. Useful help is highly appreciated
    Please note: THIS IS ABOUT Netweaver CE 7.1 - do not post stuff about 7.0!

    Hi,
    You have to return a single object from caf layer to webdynpro layer.
    Since you are returning a list of BOs, create a wrapper in caf which contains the list of your BOs.
    Your application service should return this wrapper.
    Creating Wrapper:
    1. Create a complex data type.
    2. Include your BO as one of the properties in it. and set the cardinality to 0..n.
    In Application service invoke your findAll() of BO and use the returned list to populate the wrapper's BO list.
    Return this wrapper.
    Hope it helps.
    Regards,
    Fazal

  • Web Dynpro access Application Services directly?

    We're looking at implementing some processes using Guide Procedures, and I have a question about design 'style'.
    I'm creating a data layer using Entity Services.  The entity services will be utilized by the Application Services to create a business layer.  How to do this is clear, and straightforward.
    However, where I have a question is how the automatically generated Web Dynpro application (or any other Web Dynpro application, for that matter) can interact with Application Services.  I've seen sample applications where the Web Dynpro application interacts with application services via mapping from the Web Dynpro interface layer through the GP Runtime - from my perspective, this looks like a good way to deal with a small amount of data being passed between the steps in the GP.
    The primary Web Dynpro application will let the user interact with the data, massaging it until it's in a form where the next person needs to deal with it.  I was thinking of having the Web Dynpro application interact with the Application Services layer directly to move data from the database to the web dynpro application, and back again.  The only thing that would be passed between the steps in the GP would be the guid of the primary data structure.  I would also expose a method of the Application Service as a CO which would take the guid and return the entire business object, so viewing screens could be constructed - as well, PDF's could be generated, and so on.
    Is this considered bad form in a GP, specifically accessing Application Services directly, instead of through a step in the GP?  I understand that what I want to do ties the Web Dynpro application directly to the Application Services layer, but my thinking is that the CO that encompasses the Web Dynpro should be 'atomic', in that all operations related to that specific step should be contained in a single CO.  In other words, the action of creating the business object, fiddling with it, an then submitting it upstream should be contained in one CO.
    Comments, suggestions?

    Hi,
          In the Composite Application Framework scenario, you first create the Business Entities. These act as data holder. To fill the data within these entities the Application services are created. These application services are later exposed as a webservice and deployed.
                   These webservices can contain different methods along with the CRUD operations depending on the Process Flow and Design implemented. We can import the webservices as a model in the WebDynPro Component. The UI elements of the Views can be binded to the Model. So when we execute the model methods the data gets entered into the Business objects.
                   This WebDynPro component should be a callable object ( It requires some Dependencies to be added to the WebDynPro Component ). So that you can have Input/Output parameters and ResultStates. These parameters are useful if you have to pass some parameters from one view to other within the same component. So this WebDynPro Callable object includes the Application service calls and also the passing of data through the GP Input/Output Structures.
                   These callable objects are then included within the Process.
      This is how I think a Composite Application must be designed.

  • Properties of Web Services generated from Application services in CAF

    Hi to all,
    first sorry for posting one question twice (in CAF and CE forums) but I am not sure where exactly it belongs.
    I experience problems with exposing web services from application service in CE 7.1 (trial version).
    I want to add fault elements or use document literal instead of RPC binding. I do it from the design page for web services. The problem is that after saving and regenerating the application, the changed information gets lost.
    Is it possible to expose these services while changing some information?
    And another question that would arise if this is possible. How can I catch the faults in VC? Is there e possibility to show different panels according to the value returned (from the data service, which is a web service with fault element).
    Thank You in advance!
    V S

    Hi,
    Please check note 1004108.
    Methods of Application and/or Entity Services (Business Objects) of CAF of SAP NetWeaver CE 7.1 cannot be exposed in document style, only RPC/literal is possible. Sorry.
    It's a restriction that is planned to be solved in one of the next releases.
    Regards,
       Jan

  • Calling Web Dynpro-Model of Application-Service doesnu00B4t work.

    Hello!
    I have created a Composite Application with Entity- and Application-Services. I have also created the WebDynpro-Model and use it in another WebDynpro application to call the services.
    I have a Entity-Service 'PollCatalogue' and an Application Service 'PollCatalogueApp'.
    When I call an Entity-Service to create an entity, it works:
    APollCatalogue pollcat =
                        PollCatalogueServiceProxy.createPollCatalogue();
                   pollcat.setName(name);
                   pollcat.getAspect().sendChanges();
                   IServiceFacade serviceFacade;
                   serviceFacade =
                        CAFServiceFactory.getServiceFacade(diplDefinition.class);
                   serviceFacade.save();
    But when I call the create-Method of the Application service nothing is created:
    the call is similar to above except that
    PollCatalogueServiceProxy.createPollCatalogue();
    is replaced by
    PollCatalogueAppProxy.createPollCatalogue();
    Anyway I don´t understand what is done behind the scenes. My create-Methode has one parameter name, because it is a business key. But the ServiceProxy-create-Methods do not provide a name parameter. What service-methods are called when service-facade.save() is called? In case of Entity-Service-Proxy seems to be the create method. But what if I change more than the key-parameter, what else is called? update? And in case of AppServiceProxy? ???
    Does anyone understand what is going on here?
    Thank you for your help.
    Best regards,
    Jörg

    Hi Jorg,
    About getting an exception:
    IQuery query =... ;
    query.execute() ;
    IMessageList mList = query.getResultAspect().getMessages()
    if (mList.size() > 0) {
         for (int i = 0; i < mList.size(); i++) {
             IMessage mes = (IMessage) mList.getMessage(i);
          Throwable ex = (Throwable) mes.getExtension();
         ByteArrayOutputStream bAOStream = new ByteArrayOutputStream();
         PrintStream pStream = new PrintStream( bAOStream);
         ex.printStackTrace(pStream);
            //use bAOStream in order to show stacktrace
    Regarding conceptual background about Models and Proxys:
    You can find some infomation about wd model:
    <a href="/people/valery.silaev/blog/2005/09/09/common-model-interface Model Interface</a>
    <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cef4f43e-0d01-0010-db84-ede25c874115">WQhy to use webdynpro common model interface ?</a>
    I don't know about some proxies documentation. Possible it does not exist. So, there is brief information about it:
    CAF data access services - comcafruntime~uicoupling DC. There is an implementation of com.sap.tc.col.client.generic.api api. These interfaces extends generic CMI interfaces. On top of CAF data access services implementation CAF designer generates typed CMI models which you finally use. For supporting of typed CMI models CAF provides additional build-in functionality GCP(generic client proxy) which directly operates over com.sap.tc.col.client.generic.api generic implementation.
    I recommend you to learn CAF data access implementation and read information about CMI model. That's not huge area and it gives you necessary understanding.
    Best regards,
    Aliaksei
    P.S. I don't recommend to learn and investigate the GCP implementation. That's just loss of time. The only thing that you need to know there is a black box layer which converts generic CMI model to typed model. Actually you can use generic model directly without typed. To do this use the following method for service facade getting:
    com.sap.caf.ui.utils.cool.CAFServiceFactory.getServiceFacade() ;
    but not this one:
    com.sap.caf.ui.utils.cool.CAFServiceFactory.getServiceFacade(final Class modelDefinition) ;
    and also do not use generated proxies at all, just use CMI api for model info setup for model nodes and other generic CMI api.

  • Design Model applications?

    The last step in creating a new application has a checkbox with "Save this definition as a design model for reuse" next to it. I could not see an explanation of "design model" in the HTML DB user's guide or on the Internet.
    Questions
    1) Does this mean you can have one or more template applications to speed up the development of new application?
    2) How do you change an application from not being a Design Model to being one? I created a template application without marking it as a Design Model. How can I make it one? I have the application export, but when I import it, I cannot designate it as a Design Model application.
    3) In the past I created some "test" applications with the checkboxs checked. I have since deleted these "test" applications, but they are still in the list of Design Model applications. How do I remove them from the Design Model list?
    Mike

    Mike,
    When you use the create application wizard, then the page definitions of the pages you’re adding to your application are saved as a model. So all the information about your form pages, report pages, tabular form pages, and if selected, your analysis pages, are all saved if you choose that option. When you use the create application wizard the next time, you will be able to re-use that application definition, perhaps modify it, add new page definitions, change existing page definitions, etc. And then you can create a new application based on that updated model. You can not go back to a model to modify an existing application, nor can you create a model for an application that previously didn’t have one.
    Please note that a model only stores information about your pages. Your other selections, like what theme you want to use, if you want to copy over any shared components, what kind of authentication you want to use, etc. are not stored in the model. So if you want to save a full application for future re-use, it’s best to export it, or create copies of the application.
    In order to delete an application model, you can go to your application administration, then click on manage service and go to application models. There you’ll find a list of models and a button to delete those that are no longer needed. Deleting a model has no effect on any existing applications.
    Regards,
    Marc

  • Designing SAPUI5 Application

    Hello, I am trying to gather some feedback regarding development of complex applications using SAPUI5. The scenario I have is to replicate an application which was developed in WebDynpro Java a couple of years back in SAPUI5. The WebDynpro Java Application is a loose replica of transaction IW32.
    How would I go about designing an application that has more about 100 fields spread out across 5 steps? What would the data design need to look like from a Gateway service perspective? Also how would I handle dynamic screen design i.e. Not all 100 fields are visible to all users of the application, in WebDynpro Java I play with visibility by reading the data from ECC - doing this in Java Script seems to be more challenging.
    Any thoughts / ideas will be appreciated!
    Thanks,
    Dan

    Hi Dan,
    I would follow the below step for developing Fiori like app:
    1. Design Thinking - Take the 1:1:3 approach - 1 user, 1 Role and 3 Screens
    2. Do the prototyping of your app with the help of kit, see below for the link
    3. Build the Odata Model to get data from business suite
    4. Develop the app using ECLIPSE with SAPUI5 add-ins.
    Here the link for Fiori design guidelines
    http://experience.sap.com/fiori-guidelines/
    Link for prototyping kit for Fiori Apps:
    http://experience.sap.com/fiori-guidelines/FioriDesign/52_Fiori_Design-Prototyping-Kit.html
    Link for Application Best Practices:
    SAPUI5 SDK - Demo Kit
    Netweaver Gateway can be leveraged to get data from the business suite using the Odata, find below the link for the same.
    SAP NetWeaver Gateway Foundation Master Guide - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library

  • Sharing CAF Entity/Application Service to Other CAF Project ?

    Hello,
    Currently we don't have NWDI in place and only doing local development;
    ie, using local DC's. Now we'd like to contain all CAF Entity Services
    and related Application Services in one CAF Project (CAF_BASE) and
    create other CAF Project (CAF_APP) to refer to these exposed
    Entity/App Services.
    I tried to add all entities of types [Common Model] and [Java Package Tree]
    to one Public Part  (PP01) in DC of Project CAF_BASE. In DC of Project
    CAF_APP, I included PP01 as a used DC.
    Still those Entity/App Services in CAF_BASE are not shown in CAF_APP.
    Is this by design or I did it the wrong way ?
    Ying-Jie Chen

    Hi Francesco,
    From SAP Help (see URL below),
    http://help.sap.com/saphelp_nw2004s/helpdata/en/32/07c93f26903a1ce10000000a114084/content.htm
    A statement is specified :
    >>> Start-of-SAP-Help
    Restrictions for Relations
    The following restrictions apply for relations between entity services:
         Relations between entity services can only be unidirectional. A bidirectional relation has to be modeled as two unidirectional relations.
         Entity services can only refer to (relations and inheritance):
          Other entity services of the same project
          Core entity services
         Entity services can only reference other entity services.
    <<< End-of-SAP-Help
    It says that a entity service can only refer to other entity services in the
    same project so there is no way for us to share entity services between
    projects.
    FYI,
    Ying-Jie Chen

  • How to log Exceptions raised in CAF Application Services

    Hi All,
    When there is an Exception rasing in CAF Application Service custom method implementation what are the steps need to follow for send that exception details to log files & where those log files will be generated i.e either in server, local system, etc.
    If we use following 2 different lines please explain me where that trace is going to written:
    1) System.out.println(e);
    2) e.printStackTrace();
    Thanks in Advance,
    Uday.

    Hi Uday,
    Try this (in my case I'm using that in Background CO that implements IGPBackgroundCallableObject ):
         public static Location logger =
              Location.getLocation(<yourClass>.class);
    Catch block:
              } catch (GPInvocationException e) {
                   throw new GPTechnicalCallableObjectException(
                        logger,
                        resourceAccessor,
                        "ERROR_PARAMETERS",
                        e);
              } catch (GPEngineException e) {
                   throw new GPTechnicalCallableObjectException(
                        logger,
                        resourceAccessor,
                        e.getMessage(),
                        e);
    Reward points if it's helpful.

  • Application services not working with MS Word 2004

    for some reason, application services with MS Word 2004 no longer work with Leopard for me (all grayed out). I would appreciate any advice
    thanks,
    bill

    Bill
    Because Word 2004 doesn't support Services. Firefox is another app that doesn't.
    Regards
    TD

  • SharePoint Foundation Web Application service "missing"

    Hi all,
    I've got an unusual situation. I was getting an "object reference not set to an instance of an object" error when trying to create a web application which was a little concerning.
    Although I've not got to the bottom of that yet I've discovered that the SharePoint Foundation Web Application service is "missing" when I go to the list of Services on Server in Central Admin. It's only a small farm (1 app and 1 web server) with
    the service running on the web server. 
    It must actually be running because the existing SharePoint sites are running, but obviously something's not right.
    Has anyone ever seen this happen before?
    Thanks.

    Thank you for the replies
    I've run Install-SPService but that's not made any difference.
    When I run the SharePoint Products Configuration Wizard (GUI), on the first screen (Modify server farm settings) it's showing the
    correct database server and configuration database name and "Do not disconnect from this server farm" is selected by default.
    On the next screen (Configure SharePoint Central Administration Web Application) it looks like I'm configuring a new because it wants me to specify a port for central admin. If I specify the existing central admin port then I get "The port specified
    has already been chosen". If I don't specify the port then it appears that if I continue Central Admin will be re-provisioned on a new port. 
    "False" is returned for the command  (get-spserver $env:computername).NeedsUpgrade 
    Could running psconfig from the command line fix this? If there's an issue I don't want to make things worse (although we are running in a VMware environment so I can snapshot the servers).
    Thanks.

  • How to use an Adobe interactive form in an Application service operation?

    Hi,
    I have a peculiar requirement here:
    The user wants that on the trigger of a specific operation an operation of the Application service should get invoked: this operation should pick up a Adobe form template from a destination and then prefill this forms with some values and then store the same in the backend DMS.
    It's very easy to accomplish this task in WD Java with the use of Interactive form element but here we don't want any kind of user interaction for these forms, just the form templates will be prefilled with some dynamic values and then the same will be saved as is.
    Can some one please provide some insight into how the same can be acieved, any API's etc?.
    Please reply ASAP.
    Regards,
    Manish

    hi
    try this tutorial on
    online interactive
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on online interactive pdf form - 29.htm
    for offline interactive form
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on offline interactive pdf form using download - 30.htm
    for downloading and uploading pdf forms
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on offline interactive pdf form using e-mail - 31.htm
    regards
    saravana

  • How to use bapi /external service directly in application service

    Hi
    I have to use BAPI_ALM--RDER_MAINTAIN in my caf application
    i have imported it as external service.As there are problems mapping its input fields to entity service , it has to be consumed directly vai application service.
    But i ahve never done so before.Can someone give me an example as to how t do it.
    If someone can give example of how to code in the application service to call  the bapi , it would be great . as i have some time constraint.
    Thanks ,
    Points assured for help.

    Hi Vivek,
    As you asked for an example to call a bapi directly from Application Service you can follow this link.
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/44/57fff3b10b3672e10000000a114a6b/frameset.htm">Using Generated External Proxy in Application Service</a>
    Thanks and Regards
    Avijit

  • How to use a jar-file in an Application Service - NWDS 7.01

    Hello everybody,
    I want to create an Application Service in SAP NetWeaver Developer Studio 7.01.05. Can you explain me how i can import an external jar into my project?
    I found out that I can implement or create simple java files:
    Java Perspective --> package project_name.utils --> insert/create java file
    I try to add the jar into the java build path of my project, but when i build it the jar is gone.
    I would be very thankful for every hint.

    solved
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60d99678-1a29-2d10-94b4-9d9a67b7199b]

  • Object null reference error while creating Web applications, Service applications etc after restoring AD accounts

    Hi,
    The old Active Directory accounts of my server were removed, those accounts are used by some of the SharePoint sites. A new AD account was created and when I try to replace the old accounts with new I am facing issue. I am also unable to create new web application,
    service application from my Central Administration. I also tried by restoring old accounts but still I am facing same issues, I
    am getting the error message Object
    reference not set to an instance of an object. for any create activities in Central Administration.
    Thanks in Advance for your help

    Thanks for the reply. When I am trying to update service account of services also I am getting error
    message Object
    reference not set to an instance of an object. i.e., while selecting component(web/service application from drop down) redirecting to error page

Maybe you are looking for