Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problems with tables and Web Services

I have a view that is bound to a Web Service.

The model contains one customer name etc. and many equipment lines .

The equipment lines are represented by an array of object type EquipmentLine in the Web Service.

The equipment lines are displayed in table form in the View.

I create the elements for the table at run time so that the fields within the

EquipmentLine may be entered (these are code and quantity).

This works fine and on submission the context is passed to the controller OK.

Just before the Web service call I take a look at the component controller context to make sure all is ok:

String eCode = "";
		String qty = "";
		for (int i = 0; i < n; ++i) {
			IEquipmentLineItemsElement item =
				wdContext
					.nodeEquipmentLineItems()
					.getEquipmentLineItemsElementAt(i);
			eCode = item.getEquipmentCode();
			qty = item.getQuantity();

		}

everything looks fine at this point.

then I call the Web Service:

wdContext.currentMakeDispatchElement().modelObject().execute();

Everthing is passed to the Web Service apart from the EquipmentLine details.

Here's a snippet from the SOAP created:

<ns1:makeDispatch xmlns:ns1='http://ws.xxxx.com.xxu'>
            <equipmentMovementRequest xsi:type='tns:EquipmentMovement' xmlns:tns='urn:ChepWeb'>
                <dispatchCust xsi:type='xs:string'>99999999</dispatchCust>
                <dispatchDate xsi:type='xs:string'>04/05/06</dispatchDate>
                <equipmentLineItems xsi:nil='true'></equipmentLineItems>
                <sendReference xsi:type='xs:string'>test reference</sendReference>
            </equipmentMovementRequest>

Note that the equipmentLineItems is null.

What do I need to do to get EquipmentLineItems from the context into the Web Service?

Nigel.

Former Member
replied

Hi Nigel,

What about something like this:

final MakeDispatch makeDispatch = new MakeDispatch();
final ComplexType_EquipmentMovement em = new ComplexType_EquipmentMovement();
makeDispatch.set(or add?)equipmentMovementRequest(em);

ev.setDispatchCust("Cust");
ev.dispatchDate(new Date());


for (int i = 0; i < 5; i++) {
	equipLine = new ComplexType_EquipmentLineItem();
	equipLine.setEquipmentCode("");
	equipLine.setQuantity("");
 
	em.addEquipmentLineItems(equipLine);
}

wdContext.nodeMakeDispatch().bind(makeDispatch);

Best regards, Maksim Rashchynski.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question