Skip to Content
avatar image
Former Member

serialization error [problem with setting attr values in the context]

Hello,

I have already posted this problem on the forum,

but dare to do it again as I was unable to find

any solution...

In the controller's context I have a structure like

this (in fact the structure is more complex, but it's

enough to describe the problem; I have also shortened

the node names for simplicity):

-->>Context

-


>>updateDoc [MN]

-


>>changes [MN]

-


>>docInfo [MN]

-


>>docId [MA]

-


>>boxId [MA]

where [MN] is "model node", [MA] is "model attribute".

The above structure in the controller's context

is mapped into the same structure in the model layer.

This structure (in the model layer) is used

as input/output data for calling a web service

(component controller acts as a service controller).

Before calling the web service, I set the values of both:

- Context.updateDoc.boxId and

- Context.updateDoc.changes.docInfo.docId

The problem is that after calling the web service,

I get the following error message:

"Service call exception; nested exception is:

com.sap.engine.services.webservices.jaxrpc.exceptions.XmlMarshalException:

XML Serialization Error. Property [Dinfo] of class

[pl.prokom.infos.document.metrykaplustresc.proxies.types.Doc]

must exist and can not be null.

This is required by schema description."

This message suggests that there is no docInfo subtree

in the data structure passed to the web service (docInfo

is of type Dinfo).

The problem does not appear when I set the value

of an attribute which is a direct child of the

updateDoc node (boxId is an example of such an

attribute). The error pops up only with attributes

nested deeper in the tree structure.

I use the following pattern for setting the attribute values (I set the values in the controller's code):

wdThis.wdGetContext().<nodeName>().<subNodeName>().current<nodeElement>.set<attrName>();

For example in order to set the value of the docId,

I call:

wdThis.wdGetContext().nodeUpdateDoc().nodeChanges().nodeDocInfo().currentDinfoElement().setDocId(i);

I have checked that the value does get set in the

context (I display it in the view). But as soon as

I call the web service, I get the above serialization

error (which indicates that the data structure passed

to the web service does not contain the required

docId value).

I have double checked all of the mappings.

I have double checked if the WSDL of the web service

hasn't been modified after I created the model.

As I said, the problem is only with nested attributes

(the ones that are children of the updateDoc node do

not cause any problems).

Please, help.

Greetings,

Tomek.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 27, 2005 at 05:23 AM

    Hi Tomasz

    I m also facing the same problem as yours. I have gone through various forums but didnt get any solution.have your problem solved. If so guide me to resolve this.

    I m struck up with this for the past few days.

    Anyone from SAP got any solution.Looking forward for the suggestions.

    Regards

    DhanyaR Nair

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 29, 2005 at 04:27 AM

    Finally! Found a way to overcome this, dont know if its the right way, but it has worked for me.

    <b>Scenario:</b>

    I was trying to use the RFC SXMB_GET_MESSAGE_LIST and the adaptive RFC module in NWDS gave me an exception.

    So, i exported the WSDL for this RFC using the webservicenavigator BSP and used it to generate the model class.

    I too had the same exception for the element IM_FILTER.

    The code that follows is for this RFC, please extrapolate the same to your situation.

    <b>Solution:</b>

    In the wdDoInit method of the component controller, i have the following code

    import com.dummy.model.Request_SXMB_GET_MESSAGE_LISTPortType_SXMB_GET_MESSAGE_LIST;
    import com.dummy.model.ComplexType_SXMB_GET_MESSAGE_LIST;
    import com.dummy.model.ComplexType_SXI_MESSAGE_FILTER;
    import com.dummy.model.proxies.types.SXI_MESSAGE_FILTER;
    import com.dummy.model.proxies.types.SXMB_GET_MESSAGE_LIST;
    
    Request_SXMB_GET_MESSAGE_LISTPortType_SXMB_GET_MESSAGE_LIST oRequest = 
    new Request_SXMB_GET_MESSAGE_LISTPortType_SXMB_GET_MESSAGE_LIST();
    	ComplexType_SXMB_GET_MESSAGE_LIST oParameters = new ComplexType_SXMB_GET_MESSAGE_LIST();	
    	oRequest.setParameters(oParameters);
    	wdContext.nodeRequest_SXMB_GET_MESSAGE_LISTPortType_SXMB_GET_MESSAGE_LIST().bind(oRequest);
    	SXMB_GET_MESSAGE_LIST oInputbean = this.wdContext.
    nodeRequest_SXMB_GET_MESSAGE_LISTPortType_SXMB_GET_MESSAGE_LIST()
    .nodeParameters().currentParametersElement().modelObject().getOriginalBean();
    	oInputbean.setIM_FILTER(new SXI_MESSAGE_FILTER());
    	SXI_MESSAGE_FILTER ofilter = oInputbean.getIM_FILTER();
    	ofilter.setOB_NAME("DEBMAS.DEBMAS06");
    	ofilter.setOB_NS("urn:sap-com:document:sap:idoc:messages");
    
    In the execute_..() method, i used the following code to set the parameters
    
    	SXMB_GET_MESSAGE_LIST oInputbean = this.wdContext
    .nodeRequest_SXMB_GET_MESSAGE_LISTPortType_SXMB_GET_MESSAGE_LIST()
    .nodeParameters().currentParametersElement().modelObject().getOriginalBean();
    	SXI_MESSAGE_FILTER ofilter = oInputbean.getIM_FILTER();
    	ofilter.setFROM_TIME(new BigDecimal("2001229000000"));
    	ofilter.setTO_TIME(new BigDecimal("2001229235959"));

    Hope it helps, all the best.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Amit,

      Could you please pass on how you fixed the complex type parameter problem ??

      Your help would be highly appreciateed.

      Thanks and Regards,

      Amar.

  • avatar image
    Former Member
    Jun 08, 2007 at 01:31 PM

    Hi Parag,

    Thanks a lot for this awesome message!

    Felix

    Add comment
    10|10000 characters needed characters exceeded