Skip to Content
avatar image
Former Member

Exception while executing webservice

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 05, 2009 at 04:38 AM

    Hi George,

    Please go through the discussion on the following link:

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

    It will solve your problem.

    Regards.

    Rajat

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Feb 05, 2009 at 05:17 AM
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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