cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

Hi All,

Im using WSDL to implement a functionality in webdynpro application.this WSDL requires 3 inputs :<b>flag,SampleId,Reason</b>.Im setting the values to the nodes but while deploying the

application im getting the following error:

Service call exception; nested exception is: <b>com.sap.engine.services.webservices.jaxrpc.exceptions.XmlMarshalException: XML Serialization Error. Property [FLAG] of class [apprejmodel.proxies.types.LspmRequestApprRejAdhocSampleDT] must exist and can not be null. This is required by schema description</b>

I think this error comes if i do not set the flag value .but in the code i have set the flag value

The Structure of Context is below:-

--->RequestApprReject(MN-cardinality 0..1)

-


>Lspm_RequestAppRejectSampleMT(MN-cardinality 0..1)

-


>Flag(MN-cardinality 0..n)

-


>flg(MA-cardinality 0..1)

-


>SampleId(MN-cardinality 0..n)

-


>sampleid(MA-cardinality 0..1)

-


>Reason(MN-cardinality 0..n)

-


>reason(MA-cardinality 0..1)

here im writing the code which sets the values to WSDL.

<b>Code</b>

ComplexType_ItemInner3 newFlag = new ComplexType_ItemInner3();

newFlag.setFLG(flagApp);

FlagList.add(newFlag);

ComplexType_ItemInner4 newReason = new ComplexType_ItemInner4();

newReason.setZADHOCREJRES(reason);

ResList.add(newReason);

ComplexType_ItemInner5 newSampleId = new ComplexType_ItemInner5();

newSampleId.setZSAMPLEID(sampleId);

aList.add(newSampleId);

ComplexType_LspmRequestApprRejAdhocSampleDT grid = new ComplexType_LspmRequestApprRejAdhocSampleDT();

grid.setFLAG(FlagList);

grid.setZSAMPLEID(aList);

grid.setZADHOCREJRES(ResList);

IPrivateAdhocTestView.ILspmRequestApprRejAdhocSampleMTElement ele = wdContext.createLspmRequestApprRejAdhocSampleMTElement(grid);

wdContext.currentLspmRequestApprRejAdhocSampleMTElement().modelObject().setFLAG(FlagList);

wdComponentAPI.getMessageManager().reportSuccess("flagApp:"+flagApp);

wdComponentAPI.getMessageManager().reportSuccess("newflag:"+newFlag);

wdContext.currentLspmRequestApprRejAdhocSampleMTElement().modelObject().setZADHOCREJRES(ResList);

wdContext.currentLspmRequestApprRejAdhocSampleMTElement().modelObject().setZSAMPLEID(aList);

wdThis.wdGetAdhocTestAppController().executeRequest_LspmRequestApprRej();

ArrayList abcList =(ArrayList) wdContext.currentRequest_LspmRequestApprRejAdhocSampleOSMI_lspmRequestApprRejAdhocSampleOSMIElement().modelObject().getLspmRequestApprRejAdhocSampleMT().getFLAG();

for(int k=0;k<abc.size();k++)

{

ComplexType_ItemInner3 flagtemp = (ComplexType_ItemInner3)abcList.get(k);

wdComponentAPI.getMessageManager().reportSuccess("flagvalue before wsdl exec"+flagtemp.getFLG());

}

ArrayList a1List = (ArrayList) wdContext.currentRequest_LspmRequestApprRejAdhocSampleOSMI_lspmRequestApprRejAdhocSampleOSMIElement().modelObject().getLspmRequestApprRejAdhocSampleMT().getZSAMPLEID();

for (int i = 0 ; i < a1List.size(); i++ )

{

ComplexType_ItemInner5 temp = (ComplexType_ItemInner5)a1List.get(i);

wdComponentAPI.getMessageManager().reportSuccess(" sample ID "+ temp.getZSAMPLEID()+" is approved successfully");

}

In this way im setting values and displaying values that set.

But i dont know why this Serialisation error is coming.

Any help in this issue would be appreciated.Hope u provide the solution at the earliest.

Regards,

Usha.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Usha,

Try setting the attributes on OriginalBean as below

wdContext.currentLspmRequestApprRejAdhocSampleMTElement().modelObject().

getOriginalBean().setFLAG(FlagList);

Regards,Anilkumar

Former Member
0 Kudos

Hi Anil,

When I implement the code which u sent ,to set the flag it is asking me for a parameter which is of type array that means

wdContext.currentLspmRequestApprRejAdhocSampleMTElement().modelObject().

getOriginalBean().setFLAG(<b>parameter</b> );

The <b>parameter</b> is of type array containing the complex type item for flag.

Could u please tell me how to use arrays which can contain items of type complex type item.

Regards,

Usha.

Former Member
0 Kudos

ClassName[] array=new ClassName[];

Is this you are looking for ???

Regards,Anilkumar

Former Member
0 Kudos

Hi Anil,

Thanks for ur suggestion.the problem is resolved.i changed the structure of WSDL.I tried by importing the new WSDL.

Regards,

Usha.

Former Member
0 Kudos

Hai usha,

this was the problem occurs when the wsdl definition changed.

re-import the model can solve this problem.

regards,

naga

Former Member
0 Kudos

Hi Naga,

The "Reimport Model" is not highlighted when i right click the model.Soi could not reimport the model.

Regards,

Usha.

Former Member
0 Kudos

Hi Naga,

Could u please tell what is meant by "WSDL definition changed".

Regards,

Usha.

Former Member
0 Kudos

Hai Usha,

WSdl is generated based on the method decalrartions and data types used , method signatures and soap parameters.

suppose see a method public int add(int a , int b).

when you are creating a model in webdynpro it will create some proxy classes to consume that web service. if any method signature changed in that web service

like public void add(int a , int b). the proxies are unable to reload that changes.

regards,

naga

Former Member
0 Kudos

Hai,

To reimport model

/people/sridhar.k2/blog/2006/10/10/re-importing-of-web-services-in-simpler-way

regards,

naga

Former Member
0 Kudos

Hi Usha,

Create a instance of request Object like following

RequestApprReject reqObj=new RequestApprReject(model);

ComplexType_LspmRequestApprRejAdhocSampleDT grid = new ComplexType_LspmRequestApprRejAdhocSampleDT();

grid.setFLAG(FlagList);

grid.setZSAMPLEID(aList);

grid.setZADHOCREJRES(ResList);

reqObj.setLspm_RequestAppRejectSampleMT(grid);

Regards,Anilkumar

Former Member
0 Kudos

Hi Anil,

I tried this.But this is also giving me the same exception.

Do u have any other alternative.

One more thing,the same application (webdynpro 7.0) when deployed in 2004s Web AS is woking fine.when the application is migrated to Webdynpro 2.0.9 version and deployed in 2004 version, is not working properly.

Hope u would suggest me at the earliest as this problem is a causing hinfrance to my project.

regards,

Usha.

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Usha,

Try setting "" values to mandatory fields.

Your Webservice is expecting input value for Return element. The Return value is passing as null. May be you have not binded Return element to Request object properly.

Error reason:

http://help.sap.com/saphelp_erp2005/helpdata/en/42/93d56ba5061d68e10000000a1553f6/frameset.htm

Regards, Suresh KB