Call webService WMDocumentException error

Hi all,

I have a problem calling a webservice via http with my browser:

I am trying to invoke the build service in my browser, providing a XML string. This string should be taken by the webService and it should be converted to SAP IDOC format. Additionally I the service should add some general data ro some segments / elements.

The service contains strps:

documentToRecord (XML to record)
MAP (mapping and adding data)
recordToDocument (Record to XML)
decode (XML to IDOC)
InboundProcess (ALE inbound to SAP system)

My problem is that it creates an error during the decode step. The error says:

com.wm.lang.xml.WMDocumentException: Invalid IDocXML document: Only segments are allowed on top level, found non-segment E1EDK03

I don’t know what this could be. Can anybody help me please?


Basically you have to use SAP Adapter service to form XML to IDOC structure using transformHierarchyToFlat(IDOC_Control_Rec_40,Data_Rec_40) and further steps to send into SAP system using RFC listener.

Please do search in this site related to SAP adapter and converting XML to IDOC process.


Thanks for your quick reply.

I tried the service but the node “IDOCLIST” is empty… Basicly my setup is okay, everything runs perfectly and is delivered to the connected SAP system but only if I use the “Test - SEND XML FILE” function in the developer tool. If I send the XML file with the invoke call in my browser the error occurs. Do you know what the difference is?


Is your steps working upto this steps?
documentToRecord (XML to record)
MAP (mapping and adding data)
recordToDocument (Record to XML) Are you seeing the xmldata in the pipeline?

If you are using SendXMLFile from developer just give the xmlfile path and it should run just fine.


Yes, everything is working fine in case I use the SendXMLFlie from developer.
But in case I send the same XML data as string in my browser using: http://ipadress:port/invoke/service?xmlData=XMLDataString this error occurs as reply html screen.


Looks like the Order/Sequence of the segments has been changed .

Check whether the segments are in right order in the original XML.
also check whether you add at the right location the newer data.

for Testing purpose, you can “Disable the mapping and adding data step (probably this is where you add some new segments)”


I changed the service flows:

recordToDocument (generates XML string)
stringToDocument (generates node)
decode (converts node to IDOCList)

Now via http invoke the original error is gone, but now via http invoke, the mapping setp is not done (its just left out) but all other steps…

I am nearly going mad… :o)

What do you do in the map step ??

Also could you explain your new problem a bit more


in the mapping step I am setting values for some elements and I use lookupTable transformer to substitute data in elements.

The problem seems to be, that the set and substituted values are just left out. They do are included in the elements. All other steps are working fine.
Also, again if I run it via SendXMLFile it works fine.


If you are trying to do testing with http invoke from browser then instead use pub.client:http service and pass the string and set headers/Content-type=“text/xml” and this way your receiving service input should be node and this will be in the pipeline.This way you can stimulate http transport invocation to custom service.

I believe if the steps working with Send XML file option then http service should also work fine.



thanks for your help and support. everything works fine now and I can go on testing!


Glad it worked.