on 02-21-2007 2:18 PM
RequestRead read = new RequestRead();
wdContext.nodeRequestRead().bind(read);
RequestWrite write = new RequestWrite();
wdContext.nodeRequestWrite().bind(write);
...
wdContext.currentRequestReadElement().modelObject().execute();
wdContext.nodeRequestReadResponse().invalidate();
...
String x = wdContext.currentRequestReadResponseResultElement().getName();
// debugger says: x == "abc"
wdContext.currentRequestWriteParameterElement.setName(x);
x = wdContext.currentRequestWriteParameterElement.getName();
if (x == null)
throw new OouupsException("Aaarggghhh");
The Exception is thrown.
The code is simplified, but overall it describes what I'm doing and what happend.
Why? Whats going wrong?
I'd also tried WDcopyService, the only thing I'd seen that the model attributes of the response context node were null, the "originalBean"-attribute refers to a structure with the valid model attributes values.
And neither copyCorresponding nor copyElements copies anything, even the response node of the RequestRead and the parameter node of the RequestWrite have the same complextyp
Completely helpless.
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
You are correct, you can do that way.
String x = wdContext.currentRequestReadResponseResultElement().getName();
wdContext.currentRequestWriteParameterElement.setName(x);
or
for(int i=0; i<wdContext.nodeRequestReadResponseResult().size();i++){
wdContext.currentRequestWriteParameterElement.setName(wdContext.nodeRequestReadResponseResult().
getRequestReadResponseResultElementAt(i).getName());
}
Regards,
Jhansi
Thomas,
The only thing I can guess is that somehow your node is not mapped correctly to model class. Please check your node in WD Context Designer and verify that "Name" attribute is mapped to corresponding property of model class.
Valery Silaev
SaM Solutions
Valery,
seems to be OK, means:
- there's a blue line between the attribute in the context and the corresponding attribute in the model
- the referencedProperty property is set to the valid path
- readonly is set to false
I use some other requests with input parameters, it works there.
The only difference is the nesting level.
requestNode - parametersnode - attrib1
requestNode - parametersnode - attrib2
requestNode - parametersnode - attrib3
...
works as expected,
requestNode - parametersnode - ANode - attrib1
requestNode - parametersnode - ANode - attrib2
requestNode - parametersnode - ANode - attrib3
requestNode - parametersnode - AnotherNode - attrib1
requestNode - parametersnode - AnotherNode - attrib2
requestNode - parametersnode - AnotherNode - attrib3
...
makes trouble.
The AnyNode isn't nillable in the wsdl, but SAPIDE gernerates a 0..1 cardinality and selection, IMHO 1..1 would be right.
Regards
Thomas
After some tests:
The element ANode has an internal field "gen_modelInstance" which refers to an object of the (complex) type of the node. This type object has a reference called origianlBean, which is used to store a reference to the proxy of the node.The proxy is used to store the values.
The originalBean field will not be initialized and is null, so the value can't be stored and get lost.
A more nested structure:
request- parameter-level1-l1_value ok
request- parameter-level1a-l1a_value ok
request- parameter-level1a-level2a-l2a_value null
request- parameter-level1b-l1b_value ok
request- parameter-level1b-level2b-l2b_value null
request- parameter-level1b-level2b-level3b-l3b_value ok
request- parameter-level1c-l1c_value ok
request- parameter-level1c-level2c-l2c_value null
request- parameter-level1c-level2c-level3c-l3c_value ok
request- parameter-level1c-level2c-level3c-level4c-l4c_value null
Seems that every 2nd nesting level will not be initialized.
=> IMHO an ugly bug in the model generator (or somewhere else in the dark deep of SAP).
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.