I am trying to convert the content of an IDoc XML file to an IDocDocumentList
.
The following code, heavily based on the documentation, raises an error:
com.sap.conn.jco.JCoException: (106) JCO_ERROR_RESOURCE: Destination BCE does not exist
public void xmlToIDoc(String inputXml)
{
// see provided configuration file BCE.jcoDestination
JCoDestination destination = JCoDestinationManager.getDestination(DESTINATION);
IDocRepository iDocRepository = JCoIDoc.getIDocRepository(destination); // !!!! throws exception
// parse message
IDocFactory iDocFactory = JCoIDoc.getIDocFactory();
IDocXMLProcessor processor = iDocFactory.getIDocXMLProcessor();
IDocDocumentList iDocList = processor.parse(iDocRepository, inputXml);
return iDocList;
}
I must admit that it's not really clear to me why this requires a destination and a repository. I mean, it's just an XML-to-document conversion, right?
More importantly, I have the impression that the reason why this fails, is that I have no active connection to the SAP server. Can somebody confirm this?
If that is indeed the case, then is there any other way to get this to work without an active server connection ?
Thank you in advance