Skip to Content
0
Former Member
Jan 02, 2006 at 09:24 AM

Calling a webservice with a complex data type within the code

31 Views

Hi,

I am writing a WebDynpro application for a web service created from the SAP-System. I am calling the service in the code. This is working fine with normal parameters, but my service has complex parameters and I get the following error message:

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

Could there anything be wrong with my code or is there something else I have to do?

Thank you

Julia

My code:

ComplexType_BAPI_SALESORDER_CREATEFROMDAT1 param = new ComplexType_BAPI_SALESORDER_CREATEFROMDAT1();

ComplexType_BAPISDHEAD bapishead = new ComplexType_BAPISDHEAD();

bapishead.setBILL_BLOCK("");

bapishead.setCD_CU_ISO1("");

...

param.setORDER_HEADER_IN(bapishead);

msgMgr.reportSuccess("orderHeadersin"+param.getORDER_HEADER_IN());

BAPIITEMIN bapiin[] = new BAPIITEMIN[1];

bapiin[0] = new BAPIITEMIN();

bapiin[0].setALTERN_BOM("");

bapiin[0].setASSORT_MOD("");

...

param.setORDER_ITEMS_IN(bapiin);

BAPIPARTNR bapipartner[] = new BAPIPARTNR[1];

bapipartner[0] = new BAPIPARTNR();

bapipartner[0].setADDR_LINK("");

bapipartner[0].setADDR_ORIG("");

...

param.setORDER_PARTNERS(bapipartner);

wdContext.currentRequest_Z_SalesorderCreateFromDat1_BAPI_SALESORDER_CREATEFROMDAT1Element().modelObject().setParameters(param);

wdContext.createORDER_HEADER_INElement(bapishead);

wdContext.currentRequest_Z_SalesorderCreateFromDat1_BAPI_SALESORDER_CREATEFROMDAT1Element().modelObject().execute();

wdContext.nodeRequest_Z_SalesorderCreateFromDat1_BAPI_SALESORDER_CREATEFROMDAT1().invalidate();