cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Parag,

Thanks a lot for this awesome message!

Felix

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Parag,

It worked.Thanks a lot.

You solved one of my biggest probs.i was struck for many days.

Its really a gr8 way to set the parameter.

Ofcourse u will be rewarded max points for this..Keep providing ur valuable suggestions to the needful.

Regards

DhanyaR Nair

Former Member
0 Kudos

Hi Dhanya and Parag,

I am also getting the same error as:

"class [com.intellect.polaris.proxies.types.ServiceTierPicklistRqType] must exist and can not be null. This is required by schema description."

I tried the way wat parag had told but m not getting the result .

I have a web service whose structure is as follows:

Request_CommonGenesChargesPortType_getChargeTypeProvided-->chargeTypeProvidedPicklistRq>productInfo1

\ \-----moduleId

\ \----processorId

\ \----productId

\ \---subProductId

\

\---makerDate

\--- makerId

\--- rqUID

\--- transactionCode

where productInfo1 is complex type .

As u told to write the following code in the component controller's init:

and the code is :

public void wdDoInit()

{

//@@begin wdDoInit()

Request_CommonGenesChargesPortType_getChargeTypeProvided oRequest = new Request_CommonGenesChargesPortType_getChargeTypeProvided();

wdContext.nodeRequest_CommonGenesChargesPortType_getChargeTypeProvided().bind(oRequest);

ComplexType_ChargeTypeProvidedPicklistRqType oParameter = new ComplexType_ChargeTypeProvidedPicklistRqType();

oRequest.setChargeTypeProvidedPicklistRq(oParameter);

wdContext.nodeRequest_CommonGenesChargesPortType_getChargeTypeProvided().bind(oRequest);

// ChargeTypeProvidedicklistRqType oInputBean= this.wdContext.nodeRequest_CommonGenesChargesPortType_getChargeTypeProvided().currentRequest_CommonGenesChargesPortType_getChargeTypeProvidedElement().modelObject().getChargeTypeProvidedPicklistRq();

ProductInfoType oInputBean = this.wdContext.nodeProductInfo().currentProductInfoElement().modelObject().getOriginalBean();

oInputBean.setModuleId("CD");

oInputBean.setProcessorId("CD");

oInputBean.setProductId("CD");

oInputBean.setSubProductId("CD");

//@@end

}

//////////////////////////

and i m calling a method which is written in the controller as:

public void GetCharge( )

{

//@@begin GetCharge()

int str=1;

MessageManager msgMgr = (MessageManager) wdComponentAPI.getMessageManager();

Request_CommonGenesChargesPortType_getChargeTypeProvided req = new Request_CommonGenesChargesPortType_getChargeTypeProvided();

//

try

{

ComplexType_ChargeTypeProvidedPicklistRqType reqRq = new ComplexType_ChargeTypeProvidedPicklistRqType();

// ComplexType_ProductInfoType product = new ComplexType_ProductInfoType();

reqRq.setRqUID("1234");

reqRq.setMakerDate(Calendar.getInstance());

reqRq.setMakerId("1234");

str=2;

////////////////

// ComplexType_ChargeTypeProvidedPicklistRqType oInputBean =this.wdContext.nodeRequest_CommonGenesChargesPortType_getChargeTypeProvided().currentRequest_CommonGenesChargesPortType_getChargeTypeProvidedElement().modelObject().getChargeTypeProvidedPicklistRq();

ProductInfoType oInputBean = this.wdContext.nodeProductInfo().currentProductInfoElement().modelObject().getOriginalBean();

oInputBean.setModuleId("CD");

oInputBean.setProcessorId("CD");

oInputBean.setProductId("CD");

oInputBean.setSubProductId("CD");

////////////////

// product.setModuleId("CD");

// product.setProcessorId("CD");

// product.setProductId("CD");

// product.setSubProductId("CD");

reqRq.setProductInfo(oInputBean);

str=3;

reqRq.setTransactionCode("TXN1");

req.setChargeTypeProvidedPicklistRq(reqRq);

str=4;

wdContext.currentRequest_CommonGenesChargesPortType_getChargeTypeProvidedElement().modelObject().execute();

str=5;

wdContext.nodeChargeTypeProvided().invalidate();

str=6;

}

catch(Exception e)

{

msgMgr.reportException(e.fillInStackTrace().getLocalizedMessage(), true);

// wdContext.currentContextElement().setServerMessg("failure"+str);

}

//@@end

}

tell me how can i resolve the error.I am trying hard for last 1 week.

Thanks in advance.

Regards,

amit Panchagade

Former Member
0 Kudos

Thanks for the help,

Problem is sovled.

Regards,

Amit

Former Member
0 Kudos

Thanks for the help,

Problem is solved.

Regards,

Amit

Former Member
0 Kudos

Hi Amit,

Could you please tell me how you have resolved setting the complex type parameter?

Thanks in advance

Ravi

Former Member
0 Kudos

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.

Former Member
0 Kudos

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