camel-sap fails to convert SAP iDoc document with NoTypeConversionAvailableException
Issue
There is a problem with camel-sap TypeConverter
when using Material IDOC (MATMAS03) and converting from java.lang.String
to org.fusesource.camel.component.sap.model.idoc.DocumentList
.
The route definition that fails looks like this:
<route id="route-material-idoc">
<from id="_from1" uri="sap-idoclist-server:idoc-config:MATMAS03"/>
<convertBodyTo type="java.lang.String"/>
<!-- this next conversion fails when using DocumentList-->
<convertBodyTo type="org.fusesource.camel.component.sap.model.idoc.DocumentList"/>
<convertBodyTo type="java.lang.String"/>
<to id="_to1" uri="activemq:topic:sap.idoc"/>
</route>
This route runs successfully using other IDoc types.
When trying to convert to Material IDOC (MATMAS03), the following error happens:
Caused by: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: java.lang.String to the required type: org.fusesource.camel.component.sap.model.idoc.DocumentList
Sample Payload:
<?xml version="1.0" encoding="ASCII"?>
<idoc:DocumentList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:MATMAS03---="http://sap.fusesource.org/idoc/ERQ/MATMAS03///" xmlns:idoc="http://sap.fusesource.org/idoc">
<document archiveKey="" client="200" creationDate="2017-05-18T00:00:00.000-0300" creationTime="1970-01-01T18:18:39.000-0300" direction="1" EDIMessage="" EDIMessageGroup="" EDIMessageType="MATMAS" EDIStandardFlag="" EDIStandardVersion="" EDITransmissionFile="" iDocNumber="00004124124" iDocSAPRelease="731" iDocType="MATMAS03" iDocTypeExtension="" messageCode="" messageFunction="" messageType="MATMAS" outputMode="2" recipientAddress="" recipientLogicalAddress="" recipientPartnerFunction="" recipientPartnerNumber="" recipientPartnerType="" recipientPort="" senderAddress="" senderLogicalAddress="" senderPartnerFunction="" senderPartnerNumber="" senderPartnerType="" senderPort="" serialization="20170518175216" status="30" testFlag="">
<rootSegment xsi:type="MATMAS03---:ROOT" document="//@document.0">
<segmentChildren parent="//@document.0/@rootSegment">
<E1MARAM parent="//@document.0/@rootSegment" document="//@document.0" MSGFN="" MATNR="" ERSDA="" ERNAM="" LAEDA="" AENAM="" PSTAT="" LVORM="" MTART="" MBRSH="" MATKL="" BISMT="" MEINS="" BSTME="" ZEINR="" ZEIAR="" ZEIVR="" ZEIFO="" AESZN="" BLATT="" BLANZ="000" FERTH="" FORMT="" GROES="" WRKST="" NORMT="" LABOR="" EKWSL="" BRGEW="" NTGEW="" GEWEI="KGM" VOLUM="" VOLEH="" BEHVO="" RAUBE="" TEMPB="" TRAGR="" STOFF="" SPART="" KUNNR="" WESCH="" BWVOR="" BWSCL="" SAISO="" ETIAR="" ETIFO="" EAN11="" NUMTP="" LAENG="" BREIT="" HOEHE="" MEABM="" PRDHA="" CADKZ="" ERGEW="" ERGEI="" ERVOL="" ERVOE="" GEWTO="" VOLTO="" VABME="" KZKFG="" XCHPF="" VHART="" FUELG="" STFAK="" MAGRV="" BEGRU="" QMPUR="" RBNRM="" MHDRZ="" MHDHB="" MHDLP="" VPSTA="" EXTWG="" MSTAE="" MSTAV="" MSTDE="" MSTDV="" KZUMW="" KOSCH="" NRFHG="" MFRPN="" MFRNR="" BMATN="" MPROF="" PROFL="" IHIVI="" ILOOS="" KZGVH="" XGCHP="" COMPL="" KZEFF="" RDMHD="" IPRKZ="" PRZUS="" MTPOS_MARA="NORM" GEWTO_NEW="" VOLTO_NEW="" WRKST_NEW="" AENNR="" MATFI="" CMREL="" SATNR="" SLED_BBD="" GTIN_VARIANT="" GENNR="" SERLV="" RMATP="" GDS_RELEVANT="" MCOND="" RETDELC="" LOGLEV_RETO="" NSNID="" WEORA="" /CWM/TOLGR="" /CWM/TARA="" /CWM/TARUM="" PACKCODE="" DG_PACK_STATUS="" ANP="">
<segmentChildren parent="//@document.0/@rootSegment/@segmentChildren/@E1MARAM.0">
<E1MAKTM parent="//@document.0/@rootSegment/@segmentChildren/@E1MARAM.0" document="//@document.0" MSGFN="" SPRAS="" MAKTX="" SPRAS_ISO="">
<segmentChildren parent="//@document.0/@rootSegment/@segmentChildren/@E1MARAM.0/@segmentChildren/@E1MAKTM.0"/>
</E1MAKTM>
</segmentChildren>
</E1MARAM>
</segmentChildren>
</rootSegment>
</document>
</idoc:DocumentList>
Environment
- JBoss Fuse 6.3
- camel-sap using iDoc
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.