cancel
Showing results for 
Search instead for 
Did you mean: 

Problm in importing Adaptive Webservice Model

Former Member
0 Kudos

Hai friends,

I have imported the adaptive web service model by following the below url..

"https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdjava/faq%252b-%252bmodels%252b-%252badaptive%252bweb%252bservice"

I can able to bind the input parameters of web service as

code

SumModel sm = new SumModel();

Request_Add req = new Request_Add(sm);

Add a =new Add(sm);

a.setFirstnum(0);

a.setSecnum(0);

req.setAdd(a);

wdContext.nodeRequest_Add().bind(req);

i bind the web service response to the textview - text value by using value node ( Request_Add.Response.AddResponse.Response )

But am not getting the response...

can any one Help me ...

How to bind the response value attribut

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

This should be your code

SumModel sm = new SumModel();

Request_Add req = new Request_Add(sm);

Add a =new Add(sm);

a.setFirstnum(0);

a.setSecnum(0);

req.setAdd(a);

wdContext.nodeRequest_Add().bind(req);

wdContext.currentRequest_AddElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

Also remember that you have binded the same output node (under the Request_Add node) to the table.

Regards,

Murtuza

Answers (4)

Answers (4)

Former Member
0 Kudos

Follow the following process...

1. First bind your node .

wdContext.nodeRequest_MiARG_Req_miARG_Req().bind(new Request_MiARG_Req_miARG_Req());

2. then set the values.

3.then excute the webservice...

4.then invaliadte the node...

for more clarification and code please reply...

p_2_5_6_9_6_0
Active Participant
0 Kudos

>

>

> SumModel sm = new SumModel();

> Request_Add req = new Request_Add(sm);

> Add a =new Add(sm);

> a.setFirstnum(0);

> a.setSecnum(0);

> req.setAdd(a);

> wdContext.nodeRequest_Add().bind(req);

Hi,

All you need to do is invalidate the root node of the model after the call to execute() method. For eg. if output of the model is stored in the context under node "Output", the call...

wdContext.nodeOutput().invalidate().

The tip is picked up from "Controller Coding Explained" which is a really good tutorial on using Controllers for Models.

Also, you can use the "Apply Template" and "Service Controller" options to generate the Model Custom controller so that the work of invalidation is done for you by the framework.'

Hope that helps.

Thanks.

p256960.

Former Member
0 Kudos

Krish,

As explained in the link below, do write the execute statement and get response statement in the component controller.

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/900bbf94-a7a8-2910-e298-a651b4706c1e|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/900bbf94-a7a8-2910-e298-a651b4706c1e]

If you are still not getting any response test your web service in the webservice navigator and see whether you are getting response.

Thanks,

KN.