cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming webservice from SAP XI.

Former Member
0 Kudos

Hi,

  • SAP XI has exposed one of its Message Interface as a webservice (wsdl).

  • I have made a standalone vb.net app that should consume this webservice.

  • I've imported the wsdl OK in visual studio.

  • I now have a xml document in memory that I want to send via WS to SAP XI.

The problem I'm having is that the input parameter to the WS is a object of the class ORDERS. I'm not very intrested in setting all this values to all this classes. I just want to send my xml doc.... which is a perfect match to the SAP XI Message Interface.

Maybe there is a smart way in converting my xml document into this type ORDERS?

I can see that vb.net has made a lot of methods in the back...all looking the same as my xml doc...

Dim mysrv As sapxid.MI_WEB_SalesOrder_OUTService

.....

mysrv.MI_WEB_SalesOrder_OUT(myorder) ' myorder is of type sapxid.orders

My XML in memory is looking like this...

<ORDERS xmlns:msxsl="urn:schemas-microsoft-com:xslt">

<EDI_DC40>

<DOCTYP>ORDERS05</DOCTYP>

<MESTYP>ORDERS</MESTYP>

<DIRECT>2</DIRECT>

<SNDPOR>WEB_ALE_T</SNDPOR>

<SNDPRT>LS</SNDPRT>

.....

Regards

Martin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use the DataSet method ReadXML to create a DataTable based on xml structure in memory.

If the structure of source (DataTable) and target structure exactly same (as you said) then all you need is a small sub/function using .NET reflection which will copy the values from source to destination.

Regards.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Martin,

how are you doing ?

a xsd mapping would be useful for creating a template of conversion, which can be invoked at run time, and it should give you quick results too.

with respect,

amit