cancel
Showing results for 
Search instead for 
Did you mean: 

Exception while executing webservice

Former Member
0 Kudos

Hi All,

I am trying to call a webservice in WD java. On execution the following exception is getting displayed.

java.rmi.RemoteException: Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.XmlMarshalException: XML Serialization Error. Property [BOM_COMPONENTS] of class [com.sands.demo.proxies.types.ZBAPI_BOM_GETCOMPONENTS] must exist and can not be null. This is required by schema description.

I am runnig this application in clients network using VPN.

The coding done are

wdDoInit()

Request_MI_ZBAPI_BOM_GETCOMPONENTS_MI_ZBAPI_BOM_GETCOMPONENTS requestWS=new Request_MI_ZBAPI_BOM_GETCOMPONENTS_MI_ZBAPI_BOM_GETCOMPONENTS();

ComplexType_ZBAPI_BOM_GETCOMPONENTS oParameters=new ComplexType_ZBAPI_BOM_GETCOMPONENTS();

requestWS.setParameters(oParameters);

wdContext.nodeRequest_MI_ZBAPI_BOM_GETCOMPONENTS_MI_ZBAPI_BOM_GETCOMPONENTS().bind(requestWS);

Execute Method

try {

wdContext.currentRequest_MI_ZBAPI_BOM_GETCOMPONENTS_MI_ZBAPI_BOM_GETCOMPONENTSElement().modelObject()._setUser("bapiuser");

wdContext.currentRequest_MI_ZBAPI_BOM_GETCOMPONENTS_MI_ZBAPI_BOM_GETCOMPONENTSElement().modelObject()._setPassword("bapiuser");

wdContext.currentRequest_MI_ZBAPI_BOM_GETCOMPONENTS_MI_ZBAPI_BOM_GETCOMPONENTSElement().modelObject().execute();

} catch (Exception e) {

}

Please let me know whether am missing something. I am using WebService Model.

Regards

George

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi George,

Please go through the discussion on the following link:

It will solve your problem.

Regards.

Rajat

Former Member
0 Kudos

Hi Rajat,

I have gone through the thread. But in my case, i am not setting any parameter explicitly.

All the input parameters are mapped to input field elements in the View and the user has to fill in those values. In that case how can I use the above given solution?

Regards

George

Answers (1)

Answers (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi All,

I have solved this issue. Actually I was missing initialization of a complex type and the return.

//Initializing Complex Data Type

ZPR_DATA_3[] zpr = new ZPR_DATA_3[0];

requestWS.getParameters().getOriginalBean().setBOM_COMPONENTS(zpr);

//Initializing Return Type

BAPIRET2[] ret = new BAPIRET2[0];

requestWS.getParameters().getOriginalBean().setRETURN(ret);

Regards

George