Web Dynpro and Web Service Error

Hi experts,
I followed the blog u201CDeveloping Web Services in J2EEu201D /people/lakshmi.prasad5/blog/2009/06/30/developing-web-services-in-j2ee-and-consuming-in-sap-netweaver-visual-composer-part1 and is very well explained and easy to follow. The author does two Methods and the final Web Service concatenates input fields. One Method concatenates two words and the second Method concatenates three words, the final result is the concatenation of the words in both cases.  The Web Services is working fine I already tested and do it in a Visual Composer Project. Now, I want to Execute the Web Service in a Web Dynpro for Java WD4J Project. I did my application, my model (ConcatinationWSModel) and my View. I mapped the class that concatenates two words and is call u201CRequest_ConcatinationOfStringu201D. The problem comes with the Execution of the Web Service and is showing me the next exception:
u201Ccom.sap.tc.webdynpro.model.webservice.api.WDWSModelExecuteException: Exception on execution of web service with WSDL URL 'http://<host>:<port>/WebServiceconCat/Config1?wsdl ' with operation 'concatinationOfStrings' in interface 'WebServiceconCatVi_Document'u201D
My method DoInit (Set SAP & UK):
public void wdDoInit()
    //@@begin wdDoInit()
          ConcatinationWSModel model = new ConcatinationWSModel();
          Request_ConcatinationOfStrings input = new Request_ConcatinationOfStrings(model);
          wdContext.nodeRequest_ConcatinationOfStrings().bind(input);
          ConcatinationOfStrings input2 = new ConcatinationOfStrings(model);
          wdContext.nodeConcatinationOfStrings().bind(input2);
          input2.setFString("SAP");
          input2.setSString("UK");
          ConcatinationOfStringsResponse input3 = new ConcatinationOfStringsResponse(model);
    //@@end
My method  onAction is:
public void onActionExecuteWS(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    //@@begin onActionExecuteWS(ServerEvent)
     try {
          wdContext.currentRequest_ConcatinationOfStringsElement().modelObject().execute();
wdContext.nodeRequest_ConcatinationOfStrings().invalidate();
     catch (Exception ex)
                    // TODO: handle exception
                    //        If an exception is thrown, then the stack trace will be printed
          wdComponentAPI.getMessageManager().reportException("The error is: " + ex,true);
    //@@end
I believe that the error is in the way I am executing the Web Service but I am not sure. Any help will be appreciated.
Best Regards
David Corté

Hi Jesus,
Your answer was very helpful..... The problem was with my code. The way I was executing my web service was wrong..... There are two things we have to keep in mind while we invoke any web service.... The doinit method and the execution sentence.....
public void wdDoInit()
    //@@begin wdDoInit()
     model = new ModelWebServcie();
     Request_ConcatinationOfStrings input = new Request_ConcatinationOfStrings(model);
     ConcatinationOfStrings input2 = new ConcatinationOfStrings(model);
     input.setConcatinationOfStrings(input2);
     wdContext.nodeRequest_ConcatinationOfStrings().bind(input);     
    //@@end
and the exection method:
public void ExecuteWebService( )
    //@@begin ExecuteWebService()
     try {
                    wdContext.currentRequest_ConcatinationOfStringsElement().modelObject().execute();
                    wdContext.nodeResponse().invalidate();
               catch (Exception ex)
                         // TODO: handle exception
                         //        If an exception is thrown, then the stack trace will be printed
               wdComponentAPI.getMessageManager().reportException("El error en ExecuteWS es: " + ex,true);
               wdComponentAPI.getMessageManager().reportSuccess("El Web Service fue ejecutado con exito");
    //@@end
Declare member variable for model instance:
//@@begin others
  private ModelWebServcie model;
  //@@end
Thank you for everything...
Regards
David Corté

Similar Messages

  • WEB DYNPRO AND WEB SERVICE MODEL: ejb remove doesn't work

    Hi guru,
    this is my scenario:
    J2EE-7.00 SP14-> PORTAL ->7 sp14  ->WEB DYNPRO FOR JAVA ->Web Service Model ->  WS Custom with MDM API JAVA
    The my WS is a Stateless Session Bean and i have this code:
         public void ejbCreate() throws CreateException {
              loc.setMinimumSeverity(Severity.INFO);
              loc.addLog(new ConsoleLog());
              this.plug = (MdmPlug) new MdmPlug(true);
              try {
                   this.loadProperties();
                   this.plug.connect(
                        hostname,
                        repository,
                        language,
                        username,
                        password);
                   loc.fatalT(msgLog+"[ ejbCreate ] START....");
              } catch (Exception e) {
                   if (e.getMessage()!=null)this.error=e.getMessage();
                   loc.fatalT(msgLog, this.error);
    public void ejbRemove() {
              try {
                   loc.fatalT(msgLog+"[ ejbRemove ] STOP....");
                   this.plug.close();
                   loc.fatalT(msgLog+"[ ejbRemove ] ...OK");
              } catch (ControlException e) {
                   loc.fatalT(msgLog+"[ ejbRemove ] ...K O !!!!");
    The my problem is:
    When open the IE and open my WD  the new EJB's instance is created (I see my log +"[ ejbCreate ] START....in LOG VIEWER).
    But, when I do log-off or I close IE, I don't see "[ ejbRemove ] STOP...." in LOG.
    Result:
    I open the MDM connection but not close it.
    Where is the problem?
    In Web Dynpro?
    In Web services?
    I have to create another WS's type?

    Hi Max,
    You can't run an EJBControl from a simple java class using either @Control or programmatic instantiation.
    The EJBControl implementation relies on Resource Context events so it "needs" a container context to run.
    You can use the ControlTestCase to unit test an EJB via EJB Control. You will need to configure the JNDIContextEnv annotation to bind to the server where the EJB is deployed. Note that this only works with EJBs that have a remote interface and a global JNDI name.
    The test case would look something like this (I've seen this example run as long as the JUnit classpath includes weblogic.jar)
    public class SimpleClient extends ControlTestCase {
    public void setUp() throws Exception { super.setUp(); }
    public void tearDown() throws Exception { super.tearDown(); }
    @Control
    @EchoEjbControl.JNDIContextEnv(
    contextFactory="weblogic.jndi.WLInitialContextFactory",
    providerURL="t3://localhost:7001",
    principal="weblogic",
    credentials="weblogic"
    public EchoEjbControl echoEjb;
    public void testXXX() {} // ... test methods that reference echoEjb
    Thanks
    Vimala

  • Web dynpro and Web Services

    Hi all,
    I want to create a Web Service, that calls a BAPI or RFC similar to the "Webdynpro components".
    Can someone tell me a way to create this Web Service?
    Or have I to do this manually over a EJB?
    Regards
    Olli

    Hi Olli,
    it's possible to generate Web Services from RFMs. Please have a look at the following doc: http://help.sap.com/saphelp_nw04/helpdata/en/0d/2eac5a56d7e345853fe9c935954ff1/frameset.htm
    Having done so and after WSDL generation and publishing (documentation how to do this is also available), it's possible to import the published WSDL source as a Web Dynpro Web Services model (via UDDI or URL).
    Hope that helps.
    Regards
    Stefan

  • JAVA, JAVA WEB dynpro and possibility of JAVA workflow

    Hi all
    Just a take here -- I'm just getting some feelers on the way WF SHOULD be going in future.
    Since starting to use the JAVA WD system and netweaver developer studio it seems that having to encapsulate a lot of NEW Workflows as ABAP objects is going "Backwards". (Note I said NEW not EXISTING applications)
    I understand that some compatability with existing systems needs to be maintained but if your user is doing all his applications from a Portal you really need the WF's to be triggered from the portal via say WEB SERVICES.
    I find I'm actually using the older ERP / ECC 6.0 R/3 systems these days purely as DATA repositories and from a JAVA program can often retrieve the data via standard BAPI's and RFC calls in a JAVA or Portal application.
    Isn't it about time that the workflow system as a whole was made much more JAVA and PORTAL friendly --since this is where more and more people are doing their developments from.
    Since switching more or less full time over to JAVA WEB DYNPRO developments the whole development time is completed MUCH QUICKER and with many many less mistakes.
    ABAP Web dynpro is also OK but it's still a little bit of a nightmare compared with JAVA when you need a lot of WEB SERVICES.
    Some WF's obviously will need to remain ABAP based but newer custom WF's IMO should be WEB DYNPRO and WEB SERVICE based.
    I can't think of too many large organisations who aren't making more and more use of Portals these days -- so C'mon SAP -- provide some proper Web hooks into WF's instead of us having to go through hoops and rings of writing LAST CENTURY's code to get stuff to work through a Portal.
    Cheers
    jimbo

    Hi,
    Have you checked the new BPM tool that SAP is offering? I think that it is definately a big step into to the drection that you are describing. I haven't really checked all its features and the technology that is is based on, so I am not the biggest expert of this matter.
    Check for example this article to get an overview: http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b06c49b2-ac63-2c10-3d8d-d17b817ba4ca?quicklink=nw-bpm&overridelayout=true
    Of course it will be a long road before this new tool will (if it will ever) replace the old ABAP based workflow engine.
    I wouldn't totally agree with all the points that you presented (ABAP WD being a nighmare, etc.). Actually I think that the direction (at least in some parts) is the opposite. For example SAP seem to have replaced their "old" travel management applications (Java WD) with new ABAP WD applications, so I see that they believe more in ABAP than Java (of course there might be some financial & other reasons behind this also.). In my opinion WDA has so many advantages compared to WDJ, that I would consider carefully the options when choosing the technology (the possible better(?) compatibilitly with web services might be one of the reasons).
    Regards,
    Karri

  • Error when opening workspace, web analysis and shared services

    Hi All,
    We installed hyperion 11.1.2, Essbase on a AIX server, with reports etc on a windows 2008 server. when logging onto workspace, web analysis and shared services i get the following error message:
    Error 404--Not Found
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.5 404 Not Found
    The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
    If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.
    If we re-start the server it sometimes work, but in the morining we have the same issue, can anyone help.
    Thanks
    Dylan

    Hi,
    Restart the services. Issue with Oracle Http server. If you restart foundation and other services I can bring workspace up.
    Thanks
    Radhika

  • 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

  • How to use web dynpro's web service to import XML file

    Hi
    I have an xml file and I want to use a web dynpro's web service to cosume this file which is existing on my local drive. Can anyone help me which steps I have to do to use this file as a web service using web dynpro.
    Thanks

    Hi
    You can refer below Wiki Article on SDN. I hope that will help you out.
    [https://www.sdn.sap.com/irj/sdn/wiki?path=/display/emtech/consuming%2babap%2bweb%2bservices%2busing%2bflex]
    Thanks.

  • How to integrate a Smart Form in Web Dynpro and how to view it on portal?

    Hi,
    I have created a Smart Form in ABAP. I need to use it in Web Dynpro. How can this be done?
    I want to integrate this Smart Form in a Web Dynpro Application and then display this Smart Form on the Portal (when I deploy the Web Dynpro application).
    Is it compulsory to first convert the Smart Form into PDF Format? Is there some other way ??
    Thanks in Advance.
    Regards,
    Harshada

    Hi,
    Go through Re: Web Dynpro and Smart Forms.
    Regards,
    Satyajit.

  • Abap web dynpro and portal events

    First off, a little introduction: My name is Martin Kroppen, I am an Abap developer for SAP Netherlands, and I am currently involved in a project for hospitals to built a portal. For this, I have created 2 Abap web-dynpros, and then impemented the views as iviews in an EP. What I want to achieve is that the input view triggers the display view on a second page, and the data is shown for the values in the input view (all in the same browser window).
    I am using the portal integration manager for this,  with the method for relative navigation.
    The navigation is working fine, only problem is that I don't know how to handle the business parameters that I send over.
    My questions are:
    1. is this the correct way for navigating between abap webdynpro iviews in the portal?
    2. what is the correct way to read the business parameters into my context of the second Abap WD application?
    I tried the solution that is described below, I could not get it to work correctly.
    If you define BUSINESS_PARAMETERS as application parameters in your Web
    Dynpro application and the parameter names start with &#8243;APP&#8243;, they will
    automatically be forwarded to the startup plugs of the Web Dynpro application –
    provided they are marked as startup parameters. In this case, keep in mind that
    the iView/page used as the navigation target must be assigned to the user role.
    If it is not, navigation cannot be triggered.
    Hope someone can help me…
    Regards
    Martin Kroppen

    Hi,
    please refer to this link for portal integration
    Web Dynpro for ABAP Portal Integration [original link is broken]

  • Web dynpro and database

    I need to get to the sap db from my web dynpro, and I need to be able to save/retrieve/modify data. 
    Any idea how to approach it??
    I've looked into creating ejbs but have been unsuccessful at finding an ejb document on how to create them and then use them in web dynpro.
    If not, what other ways are to go about saving/retrieving data??
    Thanks

    Hey!
    Try this out, it should work.. I would sugest that you use this code snipet on DAO's and put them in a java library project, and make reference to it from the web dynpro project properties so you don't have business logic on your WD Application, although it will also work in the WebDynpro if you copy/paste and customize this code
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Properties;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
         Connection conn = null;
         try {
              InitialContext dbInitContext = new InitialContext();
              Properties sysProperties = System.getProperties();
              String sysname = sysProperties.getProperty("SAPSYSTEMNAME");
              String dbName = "jdbc/" + "SAP" + sysname + "DB";
              DataSource dataSource = (DataSource) dbInitContext.lookup(dbName);
              conn = dataSource.getConnection();
              Statement stmtQ = conn.createStatement();
              ResultSet rs = stmtQ.executeQuery( "SELECT... ");
              while (rs.next()) {
                   //iterate query
         } catch (NamingException e) {
              //handle exception
         } finally {
              try {
                   conn.close();
              } catch (SQLException e) {
    //handle exception
    Cheers,
    JV
    Edited by: Jesus Valencia on Aug 6, 2009 11:00 AM

  • Web Dynpro and Abobe Flex

    Hi Folks,
    I've seen a couple of responses to questions about the mixing of Web Dynpro and Adobe Flex technologies...
    This thread mentions a "Flex Client" which is reportedly able to render existing Web Dynpro apps in Flex: WebDynPro ABAP in adobe flex client
    This thread mentions a technology called "Web Dynpro Islands" which is apparently Flex components within Web Dynpro apps: Flex with WebDynPro
    These concepts seem very different to me - the first being a run-time solution to Flex rendering and the second, design-time. In my opinion, the Flex Client sounds like a more flexible (excuse the pun) solution as it allows the designer to concentrate on application functionality and leaves the visual styling to the GUI. Following on from this thought, the Flex Client gives an added benefit in that, if the person executing the app wants to view it in the current WD style as opposed to Flex, they have this option by choosing a different rendering tool/user interface... and the underlying WD app remains untouched!
    Does anyone have any thoughts on this?
    On a potentially negative side of the Flex Client technology, is the this client yet another GUI tool that needs to be rolled-out and maintained on users' PCs or will it simply be a plugin that can be downloaded on-the-fly and used in a web browser (in a similar way to an ActiveX control)?
    I hope this stimulates some interesting discussions...
    Cheers
    Glen

    Thanks Thomas! I was hoping you'd be around to shed some light on this...
    You're explanation of the use of Web Dynpro Islands was very useful - I was assuming that any UI elements created for Flex designer could also be created as a Web Dynpro component for the Web Dynpro designer (ABAP or Java) but you make a good point that they have different capabilities.
    I think, my biggest concern was that the visual style of the WD Island/Flex component would be so different to the the rest of the WD app that it would stick out like a sore thumb but if you use the Flex Client to render it, as you suggested, then every UI element in the app should look and behave consistently... another assumption...
    This makes me wonder whether we'll need to use the Flex Client for all our portal apps to keep the look-and-feel consistent throughout the portal. There's nothing worse to a user than having one UI element behave a certain way in one app and a totally different way in another - eg. compare the scrolling functionality of the WD table element to the Flex table element.
    I'll look forward to hearing more about the Flex Client in the near future.
    Cheer
    Glen

  • Integrating Web Dynpro and Portal

    Hi people!
    I'm starting the development of a simple web site in SAP Enterprise Portal. I created a simple web dynpro application  to test the integration between web dynpro and SAP EP. I created a new folder and a new system in portal content. After I add a new page and a new iView (this iView open my webdynpro iview).
    My Page open normally in SAP Portal Page Admin, now i would like to know how do for include the Portal Theme, Menu, Status Bar into to my page.
    I investigated about wdPortalNavigation and wdPortalNavigationMode, but i don't understand very well how insert the Portal Navigation properties into my Page.
    How do I  insert this properties in my iView Code? or I should set this properties in Portal Admin?
    Somebody have some e-books or tutorials to indicated?
    Thanks in advance!!
    Marcelo

    Hi Marcelo,
    First of all welcome to SDN....
    For you Webdynpro pages to open with new THEME but not with default theme of portal you have to design new theme in portal and assign that  theme to WebDynpro Components
    for creation of THEMS please refer these Documents
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ccb6bcf4-0401-0010-e3bc-ec0ef03e13d1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3ea0d790-0201-0010-80b8-b680496a3838
    Please Reward Points if Helpfull...
    Regards.
    Vinit

  • Problems  with example Web Dynpro Binary Cache service.

    Hi!
    I made the example explained in PDF  Web Dynpro Binary Cache service, everything works fine but i faced a problem when a tried to download the excel file in XP  spanish version , all the columns  names came disorderly. These names are technical names of my nodes, i'm using bapis models to connect with R/3
    Who knows how can i solve this feature, the example works fine in my english XP`s version.
    Thanks!

    Hi Maria,
    which tutorial number do you refer to?
    Regards, Bertram

  • Diference Between Web Intelligence and Web Intelligence Rich Client?

    Hey Guys,
    Do you know the difference between Web Intelligence and Web Intelligence Rich Client?
    I was asked about that but i couldnt help. And i need to make a decision about a Web Intelligence training. I need to decide using one or another.
    Thanks
    Vegas

    Hi Vegas,
    The Webintelligence Rich Client (WRC) has all the features of the thin webintelligence client. But WRC makes use of the client processor and memory to do all post query processing while Infoview Webi sends every request to the server for processing.
    Thus you won't find any difference between the time taken to retrieve data from the database between these two clients. But there would be huge difference in performance while doing further analysis, formatting  with the data. Also you will not need connectivity to the network to do analysis and formatting using the WRC client.
    WRC client will help you to just retrieve the data on the fly and let you play around with it while you are traveling with no network connectivity.
    Thanks
    Mohanraj CP
    http://blog,mohanraj.org

  • Reports Web Cartridge and Web CGI

    How Reports Web Cartridge and Web CGI
    converts url into pdf and html output.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    It is my understanding that neither of the above is used by Oracle Forms with the run_product statement for WEB applications. Can anyone tell me if either of the above is used by Oracle Forms with the statement run_report_object?
    I'm asking because I want to know that if I use the run_report_object built-in (WEB environment)which replaces run_product
    (Client/Server environment), will it be able to display the parameter form as run_product currently does in the Client/Server environment. I am talking about Oracle forms calling Oracle reports.
    <HR></BLOCKQUOTE>
    Did you ever get an answer to your problem. I having trouble with bringing forms over from client server to web, I can't get a parameter form to run. I've been told to use paramform=html in the URL but where is it? Where do I place this statement?
    null

Maybe you are looking for

  • Playlist not updated during sync with added songs

    I have a manual playlist set up in iTunes where I store my  music. I then have iTunes set to sync only this playlist to my iPhone 5. However, when I've added a newly added song into this playlist, and performed a sync, the song does not move into the

  • Find every responsibility with access to function

    Hi, When they setup Applications here they went a little nuts with custom responsibilities and menus. Of course there's no doc :( Has anyone found/written SQL to determine all responsibilities with access to a given (forms) function ? Oracle's report

  • Printing a multipage document containing multiple Components

    Hi everybody, I am trying to print a multipage document which consists of multiple JPanels used for grouping, each of which hold JLabels and JScrollPanes and JTextAreas. I know how to do multipage printing with text but I am lost with the multi compo

  • Decrypt Zip File with 128bit AES

    Hello my name is George , I want to make a program to decrypt a zip file with 128-bit AES Algorithm using Brute Force and Dictionary Attack. Because it is my first time I try to make something with the encrytpion libraries I don't know much. Because

  • ITunes Opens, But Won't Play/iTunes Has Detected A Problem With Audio

    iTunes 7.4.3 and XP Pro on Dell laptop. The application opens, but no song plays. It appears at the top, but stays at zero. It keeps saying, " iTunes has detected a problem with your audio configuration." When in control panel, it says there is no au