cancel
Showing results for 
Search instead for 
Did you mean: 

problem with using webService's method throgh an Adaptive Model

Former Member
0 Kudos

Hello experts,

I need to use a simple method like <b>get(String string)</b> in my WebDynpro Application, calling it from an Adaptive webService model.

In my Controller Context I have:

Context

--Request_Get

-


InputGet

-


string

-


ResultGet

-


.... etc etc

-


.... etc etc

I've used "Apply Template">"Service Controller" in my Custom Controller so a method <b>executeGet()</b> was generated.

This method cannot pass a string to my webService, it just does

<b>wdContext.currentRequest_GetElement().modelObject().execute();</b>

so I modified it adding an input parameter <i>String</i>, and this code before the execute:

<b>wdContext.currentInputGetElement().modelObject().setString(string);</b>

Because I need to set my input string before to execute my webService's method.

At the end my method is like:

<i>public void <b>executeGet(java.lang.String string)</b> {

IWDMessageManager manager = wdComponentAPI.getMessageManager();

<b>wdContext.currentInputGetElement().modelObject().setString(string);</b>

try{

wdContext.currentRequest_GetElement().modelObject().execute();

.

.

.

}</i>

BUT it does not work, the view (that calls the controller method passing to it a string) does not display any result....

Do I missing somethings???

Please help me..

Best Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

While Using Adaptive WebserviceMode Use the following

1: Create object for Model

<modelName> objModel=new <modelName>();

2: create object for your method

<methodName> objMethod=new <methodName>(<objModel>)

In ur case

InputGet get=new InputGet(<objModel>);

3: Then, set the String required to this objMethod Object

get.setString("string");

4: Then set this objMethod to ur Reqest_...

wdContext.currentRequest_GetElement().modelObject().setInputGe(get);

or try

wdContext.currentRequest_GetElement().setInputGe(get);

5: Then Execute

wdContext.currentRequest_GetElement().modelObject().execute;

Regards

LakshmiNarayanaChowdary.N