Integration Server: documentToRecord service error

Trying to extract XML payload from inbound ebXML message. Successfully run services getContentsFromStreams, bytesToString, stringToDocument but then error on documentToRecord:

An error occurred while tracing.
com.wm.app.b2b.server.ServiceException: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1

Any ideas?
Thanks, John