cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get Web Dynpro app to work??!

Former Member
0 Kudos

Hi All,

I am currently working on a web dynpro app and am having some very annoying issues. I have created a web service using EJB and have published it successfully with java persistence and JPA. I am having issues when trying to Develop the Web dynpro interface for the from end within NWDS 7.2, the steps I have taken already are listed below:

1. Successfully created a Web service.

2. Using JPA have added java persistence for use with the web service.

3. Then put the output of the entries into a table using the web service and Visual Composer, so I know the Web Service and Data are correct and working.

4. I have then been trying to create a Web Dynpro interface within 7.2 for this and this is what i did,

a. I created a new Web Dynpro Project.

b. I then added the We Service Modal to it.

c. I then imported the Web Services Modal into the context of the Componant Controller using the Apply Template (Service Controller) Method.

d. I then created a data link to my main view and carried across all the context attributes that i wanted to display.

e. Then I applied a Template to the main view of type Table and selected the nodes that I wanted in the table.

f. Then I ran and deployed this without added any code or changing any code and it successfully deployed however the table displayed and was empty.

g. Then I tried adding the code below to the Context Controller to see if that would work, however the table did not display and I got a large error report.

public void wdDoInit()
  {
    //@@begin wdDoInit()
	  NewAWS1Model model = new NewAWS1Model();
	  ReadAllClientsResponse responseCloud = new ReadAllClientsResponse(model);
	  List list = null;
	  responseCloud.setReturn(list);
	  wdContext.nodeReadAllClientsResponse().bind(responseCloud);
	  //wdContext.nodeReadAllClientsResponse().bind(new ReadAllClientsResponse(model));
	  
    //@@end
  }

I presume I am missing some code or am not creating the code correctly, this is really annoying me as i know all the other parts work ok however i cannot display the entries. Just also to note the web service i am trying to call is designed to pull all table entries and requires no input. I hope someone can help me with this. Thanks

Edited by: anixan on Apr 12, 2010 9:03 AM

Edited by: anixan on Apr 12, 2010 9:41 AM

Accepted Solutions (1)

Accepted Solutions (1)

former_member214651
Active Contributor
0 Kudos

Hi,

From ur code, i can see that you are setting a List to the import structure in the Response node which is null. Kindly check if the ist should contain entries. Also, the binding needs to be done to the Request structure.

  • NewAWS1Model model = new NewAWS1Model();

ReadAllClientsResponse responseCloud = new ReadAllClientsResponse(model);

List list = null;

responseCloud.setReturn(list);

wdContext.nodeReadAllClientsResponse().bind(responseCloud);

//wdContext.nodeReadAllClientsResponse().bind(new ReadAllClientsResponse(model));*

Regards,

Poojith MV

Edited by: Poojith M V on Apr 12, 2010 10:32 AM

Answers (8)

Answers (8)

Former Member
0 Kudos

can anyone explain why this might not be working or why it would work within visual composer??? Any reply would be great at this stage. Thanks

Former Member
0 Kudos

Hi Experts,

I hate to keep posting but i have been trying alot of different methods of pulling in the data and i am still at a loss, is there anyway to test to make sure that the Model is being executed correctly and the entries are being pulled into the Component Controller as a first step and then maybe I can assess weather it is not being passed to the view context correctly. Again I was trying various ways of putting the model contents into the context and i remade the codeon the "wdDoInit()" as shown below with no sucess. I would really appreciate someone coming with a suggestion on this as I am lost to why this is not working. Thanks

public void wdDoInit()
  {
    //@@begin wdDoInit()
    //$$begin Service Controller(-746844707)
	  
	  CloudModel model = new CloudModel();
	  Request_ReadAllClients request = new Request_ReadAllClients(model);
	  request.setReadAllClients(new ReadAllClients(model));
	  wdContext.nodeRequest_ReadAllClients().bind(request);

    //$$end
    //@@end
  }

Edited by: anixan on Apr 15, 2010 9:40 AM

Former Member
0 Kudos

Hi can someone please help me with this as I know I must be close to getting this app up and running, I believe it is something with the way i am executing my model as the model is returning multiple entries and not just one, I thought the code I had shoudl have worked but doesnt and i am confused as to the issue, i would really appreciate some help with this? Thanks

Former Member
0 Kudos

Hi as I have said in my previous post I now believe that I have setup the system landscape correctly as I am no longer getting any error although the data is still not being displayed in my table. I have modified the wdDoInit on the component Controller which i thought would work as shown below, is this code wrong or is there code that i need to place somewhere else in order for this to work?

public void wdDoInit()
  {
    //@@begin wdDoInit()
    //$$begin Service Controller(-746844707)
	  
	    CloudModel cloudModel = new CloudModel();
	    Request_ReadAllClients request_ReadAllClients = new Request_ReadAllClients(cloudModel);
	    ReadAllClients readAllClients = new ReadAllClients(cloudModel);
	    request_ReadAllClients.setReadAllClients(readAllClients);
	    Response_ReadAllClients response = new Response_ReadAllClients(cloudModel);
	    request_ReadAllClients.setResponse(response);
	    ReadAllClientsResponse readAllClientsResponse = new ReadAllClientsResponse(cloudModel);
	    response.setReadAllClientsResponse(readAllClientsResponse);
	    java.util.List<CloudClient> return_1 = new ArrayList<CloudClient>();
	    readAllClientsResponse.setReturn(return_1);
	    wdContext.nodeRequest_ReadAllClients().bind(request_ReadAllClients);

    //$$end
    //@@end
  }

Thanks

Edited by: anixan on Apr 13, 2010 9:48 AM

Edited by: anixan on Apr 13, 2010 12:45 PM

Former Member
0 Kudos

Hi,

Thanks for the help I have now gone into the NWA and set up the provider system, I now do not get the error as I did before however i do not get anything in the table and it is empty, what could this be due to? Thanks

Former Member
0 Kudos

I have also tried the code below with no sucess, can someone please help me with this as i cannot understand why i keep getting the same errors as above if the it works with Visual Composer. Please help!! Thanks

public void wdDoInit()
  {
    //@@begin wdDoInit()
    //$$begin Service Controller(-746844707)
	  
	    CloudModel cloudModel = new CloudModel();
	    Request_ReadAllClients request_ReadAllClients = new Request_ReadAllClients(cloudModel);
	    ReadAllClients readAllClients = new ReadAllClients(cloudModel);
	    request_ReadAllClients.setReadAllClients(readAllClients);
	    Response_ReadAllClients response = new Response_ReadAllClients(cloudModel);
	    request_ReadAllClients.setResponse(response);
	    ReadAllClientsResponse readAllClientsResponse = new ReadAllClientsResponse(cloudModel);
	    response.setReadAllClientsResponse(readAllClientsResponse);
	    java.util.List<CloudClient> return_1 = new ArrayList<CloudClient>();
	    readAllClientsResponse.setReturn(return_1);
	    wdContext.nodeRequest_ReadAllClients().bind(request_ReadAllClients);
	  
    //$$end
    //@@end
  }

Edited by: anixan on Apr 12, 2010 3:45 PM

Former Member
0 Kudos

I have tried to update the wdDoInit with the following code, however I am still getting the same error which I have also included below.

Caused by: com.sap.tc.webdynpro.services.exceptions.ApplicationFaultException: wdDoInit: exception thrown in this user coding area

Caused by: com.sap.tc.webdynpro.model.webservice.exception.WSModelRuntimeException: Exception on creation of service metadata for web service mass config parameters service reference ID 'f3e2cd13-426c-4be7-990a-5c4608ed589a' and application name 'demo.sap.com/testapp2'. Check mass configuration has been done properly.

Caused by: javax.xml.rpc.ServiceException: Configuration not found for application: demo.sap.com/testapp2,serviceRefId:f3e2cd13-426c-4be7-990a-5c4608ed589a. Please check the configuration details from the NWA. You may have not assigned the Service Group to a Provider System, or the generation of the configuration has failed.

public void wdDoInit()
  {
    //@@begin wdDoInit()
    //$$begin Service Controller(-746844707)
	  
	  CloudModel model = new CloudModel();
	  Request_ReadAllClients request = new Request_ReadAllClients(model);
	  request.setReadAllClients(new ReadAllClients(model));
	  wdContext.nodeRequest_ReadAllClients().bind(request);
	   
    //initRequest_ReadAllClients();
    //$$end
    //@@end
  }

Edited by: anixan on Apr 12, 2010 12:36 PM

Former Member
0 Kudos

Hi Anixan,

Refer to guide below on overview of Service Groups bound to Provider System, it might help you with your missing config:

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40dabb46-dd66-2b10-1a9a-81aa620098b3?quicklink=index&overridelayout=true]

Regards, Trevor

Former Member
0 Kudos

Ok thanks for the response I have now looked at this and have noticed some things that dont seem right. I went ahead and created a new project and this time using the Service Control template on the Component Controller I used the "Request_ReadAllClients" class and then created the data link to the view and applied a Table template on the view. I did now create and code or change any, I then deployed the ap and got a "Error 500" message.

I have listed the wdDoInit code below and i know I need to change this but as the web service I am calling does not need any input and only retrieves a list of entries automatically, what do i need to change on the wdDoInit code and also is there any other code i need to change as im sure there might be. I will also place the Execute code below as well that is also on the Conponent Controller:

public void wdDoInit()
  {
    //@@begin wdDoInit()
    //$$begin Service Controller(-746844707)
    initRequest_ReadAllClients();
    //$$end
    //@@end
  }

public void executeReadAllClients( )  {
    //@@begin executeReadAllClients()
    //$$begin Service Controller(1579462324)
    try
    {
    wdContext.currentRequest_ReadAllClientsElement().modelObject().execute();
    } catch(Exception e){
    wdComponentAPI.getMessageManager().reportException( e.getMessage());
    }
    //$$end
    //@@end
  }