Skip to Content
avatar image
Former Member

Problems with deep request structure in web service

I'm having problems when trying to consume an Enterprise Service-like web service in my Web Dynpro application. The web service FindXByElements has a request-structure as follows:

XByElementsQuery -


ProcessingConditions -
QueryHitsMaximumNumberValue -
QueryHitsUnlimitedIndicator -
XSelectionByElements -
ID -
Year

Regarding the structures on level two, the structure ProcessingConditions are of the global data type "WITHOUT_LASTRETURNED_QueryProcessingConditions" and are therefore typed. The structure XSelectionByElements on the other hand are just a "level" in the request structure and are therefore not typed. Both structures have occurrence 1 so they have to be filled with input data.

The code in wdDoInit in the Component Controller looks like this:

QueryXInModel model = new QueryXInModel();
wdContext.nodeRequest_FindXByElements().bind(wdContext.createRequest_FindXByElementsElement(new Request_FindXByElements(model)));
wdContext.currentRequest_FindXByElementsElement().modelObject().setXByElementsQuery(new XByElementsQuery_Sync(model));
  	
//Processing structure
wdContext.currentXByElementsQueryElement().modelObject().setProcessingConditions(new WITHOUT_LASTRETURNED_QueryProcessingConditions(model));
  	
//Selection structure
wdContext.currentXByElementsQueryElement().modelObject().setXSelectionByElements(new XSelectionByElements(model));

The last row generates the following exception:

java.lang.IllegalArgumentException: Cannot perform write operation 'setRelatedModelObject' on target role: Class 'XSelectionByElements' is not compatible to class '$002fWsdlDefinitions$002fWsdlTypes$002fXsdSchema$002fXsdComplexType$005b3$005d$002fXsdSequence$002fXsdElement$005b2$005d$002fXsdComplexType' of target role 'XSelectionByElements' in model class 'XByElementsQuery_Sync'

There seems to be a problem to bind a non-typed structure element to a context node since the processing structure is working fine but the selection structure are not.

What am I doing wrong, anyone got any clues?

/Oskar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Mar 09, 2009 at 04:05 AM

    Hi

    QueryXInModel model = new QueryXInModel();

    wdContext.nodeRequest_FindXByElements().bind(wdContext.createRequest_FindXByElementsElement(new Request_FindXByElements(model)));

    wdContext.currentRequest_FindXByElementsElement().modelObject().setXByElementsQuery(new XByElementsQuery_Sync(model));

    //Processing structure

    wdContext.currentXByElementsQueryElement().modelObject().setProcessingConditions(new WITHOUT_LASTRETURNED_QueryProcessingConditions(model));

    //Selection structure

    wdContext.currentXByElementsQueryElement().modelObject().setXSelectionByElements(new XSelectionByElements(model));

    XByElementsQuery

    -


    ProcessingConditions

    -


    QueryHitsMaximumNumberValue

    -


    QueryHitsUnlimitedIndicator

    -


    XSelectionByElements

    -


    ID

    -


    Year

    as

    QueryXInModel model = new QueryXInModel();

    Request_FindXByElement request = new Requst_FindXByElement();

    ProcessCondition processCond = new ProcessCondition(model);

    QueryHitsMaximumNumberValue qhMaxNumValues = QueryHitsMaximumNumberValue(model);

    QueryHitsUnlimitedIndicator qhUnLimind = new QueryHitsUnlimitedIndicator(model);

    XSelectionByElements selecByEle = new XSelectionByElements(model);

    processCond.set....();

    qhMaxNumValues .set...();

    and so on

    request.set....();

    wdcontext.nodeReqestFindX..bind(request);

    in the above during the values you will automatically get the set values .

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 09, 2009 at 08:07 AM

    Hi and thanks for the reply!

    Unfortunately your code doesn't help, I still get the same IllegalArgumentException.

    Regarding my theory about non-typed structures, when I import my web service in CAF it is very clear that the Processing structure is of the type "WITHOUT_LASTRETURNED_QueryProcessingConditions" but the Selection structure is "<anonymous>".

    /Oskar

    Add comment
    10|10000 characters needed characters exceeded