cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the Web Service Model?

Former Member
0 Kudos

Hi,

Here is the story. I have web services deployed at a certain URL and they are working correctly. Now I want to use them in my WebDyn Pro application. So I created an Adaptive Web Service model from the URL using the default settings. I now have the model in WD. Now I add it as a used model in my component. I drag and drop one of my services Request_***** tree in my Controller. I did the same thing in my view. Now, how do I call the service?

Thanks in advance for any information on the subject you can give me.Here is What I tried in the wdDoInit of my view (the problem I encountered are comments above each statements):


  //@@begin javadoc:wdDoInit()
  /** Hook method called to initialize controller. */
  //@@end
  public void wdDoInit()
  {
    //@@begin wdDoInit()
    //Load the data for the units table
    
	try
	{
		//from the controller, the currentRequest_GetUnitsElement is null at run time
		IPublicPAFDAnalysis.IRequest_GetUnitsElement wRequestElement = 
				wdThis.wdGetPAFDAnalysisController().wdGetContext().currentRequest_GetUnitsElement();
		wRequestElement.modelObject().execute();
		
		//try creating an element, where can I get the model from?
		IPublicPAFDAnalysis.IRequest_GetUnitsElement wRequestElement = 
				wdThis.wdGetPAFDAnalysisController().wdGetContext().createRequest_GetUnitsElement();
		
		//from the view, the currentRequest_GetUnitsElement is null at run time
		wdThis.wdGetContext().currentRequest_GetUnitsElement().modelObject().execute();
		
		//try creating an element, where can I get the model from?
		IPublicPAFDAnalysis.IRequest_GetUnitsElement wRequestElement = 
				wdThis.wdGetContext().createRequest_GetUnitsElement();
		
		
		wdThis.wdGetPAFDAnalysisController().wdGetContext().nodeRequest_GetUnits().invalidate();
	}
	catch(Exception pE)
	{
		//an error occured when trying to get data from the web service
		pE.printStackTrace();
	}
    
    //@@end
  }

I should have mentioned that we are using netweaver 2004s for the first time.

Message was edited by: Mathieu Poitras

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I was able to do it using the Apply template option on the controller. It created a executeRequest method in the controller and created the model and the nodes in the wdDoInit of the controller. I hope this can be useful to others.