cancel
Showing results for 
Search instead for 
Did you mean: 

How to access CAF Entity Service from WD (Java)?

Former Member
0 Kudos

Hello everyone!

I have created some business objects and application services using "Composite Application" perpective of Developer Studio SP5. All of them was tested succesfully.

I want to create an Web Dynpro application, which will be use my application services. I have imported them in "Model" as "Enterprise JavaBean Model". All is ok, but how can I access these model now from wd component or view controller?

All articles I have found are about integrating services using 2004 or 7.0 developer studio, but I can't do the same using Developer Studio SP5. Thanks for any help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The best practice is to expose the Application Services as Web Services.

Then you have to import the webservices as Adaptive Webservice Model. This you will have in you models. Then you can access them.

Regards,

Srinivasan Subbiah

Former Member
0 Kudos

Thanks, I'll try it. But is there any way to use services as "EJB model"?

Former Member
0 Kudos

Hmm, I have tried "Adaptive Webservice Model", but I still can't understand, how can I call any method of my service. Now I have 2 models (EJB and WS) in WD application, how can I use it?

Former Member
0 Kudos

Import the corresponding model and all its request objects and use the following code.


<model object> mod = new <model object>();
<Request Object of the method> req = new <Request Object of the method>(mod);
req.execute();
req.getResponse().getGetAll_RResponse().getResponse();

Former Member
0 Kudos

I have written:

WSModel wsModel = new WSModel();

Request_Say wsReq = new Request_Say(wsModel);

try {

wsReq.execute();

} catch (WDWSModelExecuteException e) {

e.printStackTrace();

}

// There is no "getGetAll_RResponse()" method, so "req.getResponse().getGetAll_RResponse().getResponse();"

// is illegal...

String wsTemp = wsReq.getResponse().getOutputParameter1(); //Here I've got NullPointerException

Are there any other ideas about this problem?

Former Member
0 Kudos

I've fot an exception during

wsReq.execute();

but WebService was tested successfully using wsnavigator. How can I overcome it?

Former Member
0 Kudos

Moreover, when I am using ejb model, all is ok:

EJBModel ejbModel = new EJBModel();

Request_MyServiceServiceLocal_say ejbReq = new Request_MyServiceServiceLocal_say(ejbModel);

try {

ejbReq.execute();

} catch (EJBModelExecuteException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

String answer = ejbReq.getResponse().getReturn();

Thereby, my question is about WebService - I have already tested ws, when i call wsReq.execute, I get an exception. How can I overcome this situation?

Former Member
0 Kudos

Hi Borodin,

Are you using CE? My code examples are for 7.0. Also can you post a stack trace of the exception.

Answers (0)