cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive WebService Model: why initialization of context attributes ?

Former Member
0 Kudos

Hi,

I am very new to web dynpro and perhaps my question is very strange or my way to handle with the adaptive web service model. If I want to bind input parameters of a web service to gui elements I always get a Null Pointer Exception. To avoid this I have to initialize the attributes before (actually it depends on the data type, strings are ok, if i use long i get the exception).

For better understanding some code:


       // instantiate objects for nodes
	Request_FindProductGroupById requestFindId = new Request_FindProductGroupById(model);
	FindProductGroupById findProdMO = new FindProductGroupById(model);
	
	// just for the sake to avoid a null pointer exception
	findProdMO.setId(0);
	
	// associate model objects
	requestFindId.setFindProductGroupById(findProdMO);
	// bind executable model object to context node
	wdContext.nodeRequest_FindProductGroupById().bind(requestFindId);

If I dont set the Id to 0 I get a Null Pointer Exception. But if I set it logically the user sees the 0 and has to override it. Is there a way to avoid this scenario ?

Regards

Flo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

found this in Adaptive WebService Model FAQ

WSDL Support Limitations

The dynamic web service client proxy support only rpc/document literal SOAP Bindings.

For certain types (e.g. integer), attributes declared as nillable in the WSDL will work properly only as long as they do not contain null as data value (as of NW 7.0 SP 13). Possible workaround: Use type String for transferring the data and cast on both sides.

Thanks for the link.

Former Member
0 Kudos

Hi Murtuza,

thanks for your reply. I get the nullpointer exception before the page is loaded. Btw I dont have to set it exactly to 0. It could be any other value. If I set the attribute to any value this value is showed in the input field, and if not the user dont see the page then he gets a screen with the null pointer exception.

The parameter is mandatory, but I dont want to make suggestions for the user. The user should type any value in the input field. I dont want that he finds a value there.

Regards

Flo

Former Member
0 Kudos

Hi,

I would like to know where do you get nullpointerException when you don't set the value to 0.

Is It a manadatory parameter? If yes, then check whether user has passed some value for that or no and if you have its value then execute the RFC else display some error message to the user.

Regards,

Murtuza