cancel
Showing results for 
Search instead for 
Did you mean: 

structure as parameter to web service

Ronib
Participant
0 Kudos

hi

i'm calling xi web service that should get a structure as input parameter.

i create the element (with model parameter) and add it to the node.

i check that the element is really added to the node ( i display the table) and then i execute the web service.

in the xi i see that the input is empty: only </item> tag.

does any one can help?

Roni

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Roni,

Please provide the code how you have passed structure values to the Web Service model. also provide Web servcie model structure appears in WD context.

Regards,

Bhavik

Ronib
Participant
0 Kudos

i see a message in xi but the resultCreate Element is just not getting there.

the rfc works fine , i'm sure the problem is in the adding of the row to the table of input.

the code is:

<i>

Request_x input = new Request_x();

wdContext.nodeRequest_x().bind(input);

ComplexType_ORD model = new ComplexType_ORD();

IPublicRemarksCust.IResultCreateElement elem = wdContext.nodeResultCreate().createResultCreateElement(model);

elem.setKUNNR("a");

elem.setTEXT("b");

wdContext.nodeResultCreate().addElement(elem);

input._setUser("x");

input._setPassword("y");

input.execute();

</i>

Former Member
0 Kudos

Roni,

Try this:


Request_x input = new Request_x();
ComplexType_ORD model = new ComplexType_ORD();
model.setKUNNR("a");
model.setTEXT("b");

/* If cardinality is 0..1 */
input.set<ResultCreate>( model );
/* If cardinality is 0..n
input.add<ResultCreate>( model );
*/

wdContext.nodeRequest_x().bind(input);

input._setUser("x");
input._setPassword("y");
input.execute();

I.e. modify model objects rather then context. Context should reflect structure of your model objects automatically, the reverse is not always the case. Also make sure that ResultCreate node has supplyingRelationRole property set (check properties in Controller Context editor)

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Answers (1)

Answers (1)

Ronib
Participant
0 Kudos

thanks!

seems that this code is working

<i>

ORD_DT ord1 = new ORD_DT();

ord1.setKUNNR("a");

ORD_DT[] vector = new ORD_DT[1];

vector[0] = ord1;

input.setORD_HEARA(vector);

</i>