I have an orchestration, receiving an XML-file from via the File Adapter. I need the filename to store in a database.
When placing the project in the production environment, we decided to use the FTP adapter instead of the File Adapter.
With BizTalk, It should be easy to change the receive ports.
I used in my orchestration line of codes like ReceiveXmlMessage(FILE.ReceivedFileName), but when changing the File Adapter to FTP adapter in the BizTalk Administration Console, something went wrong.
- Create a variable: fileName in your Orchestration
- Add an Expression Shape to you Orchestration
- Add the following Code into the expression shape:
tempString = "UNKNOWN";
if(FILE.ReceivedFileName exists ReceiveXmlMessage)
else if(FTP.ReceivedFileName exists ReceiveXmlMessage)
Not working Solutions:
I thought the following code would work, but I received an error saying that ReceiveXmlMessage(FTP.ReceivedFileName) was empty while using the File Adapter.
Not working code:
fileName = ReceiveXmlMessage(FILE.ReceivedFileName) + ReceiveXmlMessage(FTP.ReceivedFileName)