on 03-14-2007 5:14 PM
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.
Hi Usha,
Try setting the attributes on OriginalBean as below
wdContext.currentLspmRequestApprRejAdhocSampleMTElement().modelObject().
getOriginalBean().setFLAG(FlagList);
Regards,Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Hai usha,
this was the problem occurs when the wsdl definition changed.
re-import the model can solve this problem.
regards,
naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.