cancel
Showing results for 
Search instead for 
Did you mean: 

bind allowed if a node has a supply function or a supplying relation role

Former Member
0 Kudos

Hello Context-exports,

I am using NetWeaver CE 7.1 and have implemented a WebService TRCROOF with the following method:

public void assign(List<TRPartDTO> trparts);

The class TRPartDTO is defined as follows:

public class TRPartDTO implements Serializable {
    BigDecimal idProject;
    BigDecimal idSynth;
    String traceIndex;
    String serialNo;
    ...
}

I have imported the WebService into WebDynpro as Adaptive WS-Model.

The wizard has built this context:

Request_Assign

---Assign

-


Trparts

-


IdProject

-


IdSynth

-


TraceIndex

-


SerialNo

---Response_Assign

In wdDoInit I call the following sequence, which works fine:

TRCROOF_MODEL trcRoofModel = new TRCROOF_MODEL();
Request_Assign request_Assign = new Request_Assign(trcRoofModel);
Assign assign = new Assign(trcRoofModel);
request_Assign.setAssign(assign);
wdContext.nodeRequest_Assign().bind(request_Assign);

Now I try to call the WebService-Method and to deliver a list to it:

ITrparts_Assign_TRPartsElement newPart;
Vector<ITrparts_AssignElement> partList = new Vector<ITrparts_AssignElement>();
for (int ix = 0; ix < cnt; ix++) {
   newPart = wdContext.nodeTrparts()
		    .createTrparts_Element(
			    new TrPartDTO(trcRoofModel);
   newPart.setIdProject(...);
   newPart.setIdSynth(...);
   newPart.setSerialNo(...);
   newPart.setTraceIndex(...);
   partList.add(newPart);
}
wdContext.nodeTrparts_Assign_TRParts().bind(partList);

But when calling bind() I get an exception that essentially tells me:

"calling bind is not allowed if a node has a supply function or a supplying relation role"

Background info:

My EJB defining the WebService implements another DTO-class named RoofDTO, which includes a List of TRPartDTO:

public class RoofDTO implements Serializable {
    ...
    private List<TRPartDTO> trparts;
    ...
}

But this class is not used in conjunction with the method assign().

Nevertheless the wizard that imported the WebService-Model of course has

defined a relation betweeen these classes.

Could anybody explain the situation or even tell me how to fix my problem?

Thanks for each hint,

Christoph

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Oops,

forget this silly question. In case that anybody else has such cranky trains of thoughts as me: Do it like this:

Vector<TrPartDTO> partList = new Vector<TrPartDTO>();
trcRoofModel = new TRCROOF_MODEL();
for (int ix = 0; ix < ...; ix++) {
   partList.add(new TrPartDTO(trcRoofModel));
}
wdContext.currentAssignTRPartsElement().modelObject().setTrparts(partList);

Kind regards,

Christoph