cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive WebService and late binding of nodes

Former Member
0 Kudos

Hi,

my Model has the folowing structure:

Request

-- out

-- In (1..1)

-- In -- Node1 (0..1)

-- In -- Node1 --- MandatoryField

-- In -- Node2 (0..1)

-- In -- Node2 --- MandatoryField

-- In -- Node3 (0..1)

-- In -- Node3 --- MandatoryField

At least one of the nodes (1 - 3) must be filled when executing the request..

Usually the initializing of the model is done in the wdDoInit. This will not work in this case, if a NodeX doesn't exist, MandatoryField doesn't exist and the execution fails.

So I have to initialize and bind the nodes directly before the execution of the request..

I'd tried different ways to create and bind a new NodeX, but nothing works for me. No data is tranfered to the WebService backend..

Does soneone know how to solve this?

TIA

Thomas Paulsen

Accepted Solutions (0)

Answers (1)

Answers (1)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Thomas,

what's the real problem here? I assume that you do not execute the model object initially. Why should the nodes with mandaotry fields not exist? These singleton nodes exist and they must contain single node elements being set by the user on the UI. You must make sure that the model object graph is being created correctly. This means you must programmatically bind the model object graph to the context. I assume you did not correctly implement this binding.

Read more details on this topic in my special article <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/900bbf94-a7a8-2910-e298-a651b4706c1e">Adaptive Web Service Model – Controller Coding Explained Published</a>.

Regards, Bertram

Former Member
0 Kudos

Hallo Bertram

The real problem:

I don't know the data I have to store in the moment wdDoinit() is executed:

Think about a child. A child has a mother and a father. All of them have a mandatory attribute "Name".

Usually the mother is known, but the father...

And a foundling?

So the child node have a mandatory attribute "Name" and two optional nodes "Mother" and "Father". If they where known, they must have a name.

It is easy to create values nodes in the context to allow entering the data in the UI.

But when I initialize the model in the wdDoInit(), I don't know whether there will be entered one of the parents name or not. If I initialze the parent's nodes, I need values for the names, otherwise the execution of the save request fails.

So my idea is to initialize the parent's nodes directly before executiing the request, not during wdDoInit(). This is the moment I know if those name values were entered or not.

This is (a little bit simplified) my problem.

(The real problem is the (in wsdl allowed and inside the model not supported ) inheritence.

The nodes I can't initialize during wdDoInit() are storing attributes of the different inherited object types.

This is my workaround for this limitation.

The structure, optional/nillable Nodes with mandatory attributes, will not give any errors or warnings during the creation of the model.

It would be an error if it is impossible to handle this structure a runtime, so I think it's my fault. But I don't know how to handle this)

Regards

Thomas