cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Result Class from Model invocation

Former Member
0 Kudos

Hi experts,

I would like to invoke a webservice request which return a list of Object as a response.

I refer to the adaptive web service model for web dynpro, however, the example is only to sent a list of input object to the web service.

//@@begin javadoc:sendEmail()

/** Declared method. */

//@@end

public void sendEmail() {

//@@begin sendEmail()

...

// call Email Web Service and update dependent model node 'Response'

wdContext.currentRequest_SendEmailElement().modelObject().execute();

wdContext.nodeResponse().invalidate();

...

//@@end

}

if I were to have an object say SaleDetails return as response instead of a integer (returnCode as show in the example). Can i do the following:

wdContext.currentRequest_SendEmailElement().modelObject().execute();

wdContext.nodeResponse().invalidate();

SaleDetails details = (SaleDetails) wdContext.currentRequest_SendEmailElement().getAttributeValue("saledetails");

can advise?

thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You are talking about the response of the model node. If the webservice is supposed to return an object of type SaleDetails, then the response node will contain a node of SaleDetails type with all the attributes of SaleDetails.

You dont have to explicitly cast anything.

thanks & regards,

Manoj