Updating .pdf file issue in sql

Asked By Abhishek Iyer
31-Aug-10 09:10 AM
Earn up to 0 extra points for answering this tough question.

I have to update a .pdf filename in the database in a file -> Sql scenario. The number of files are ennumerous and each file has a corresponding entry in SQL table.

for eg: the database entry is : abc.pdf

The error i'm getting is :

A message received by adapter "FILE" on receive location "Receive Location2" with URI "C:\Projects\Udatepdfstatus\in\*.pdf" is suspended.

Error details: The published message could not be routed because no subscribers were found. This error occurs if the subscribing orchestration or send port has not been enlisted, or if some of the message properties necessary for subscription evaluation have not been promoted. Please use the Biztalk Administration console to troubleshoot this failure.

 

The same thing, if it's an .xml file, works fine. I have my pipelines as PassThrough in both the send and receive ends.

Could anyone tell me where I'm going wrong or is it that the .pdf thing can't be handled in Biztalk?

  re: Updating .pdf file issue in sql

Mohan Raj Aryal replied to Abhishek Iyer
31-Aug-10 11:44 AM
Please make sure: 

-> Since you are receiving PDF, you will either need to use passthru pipeline which simply publish your message to the messagebox database. Or write your custom pipeline if you are dealing further with PDF file.
-> The error is mentioning clearly that your received message is suspended because there is no subscriber who is waiting for that message. Note that the basic fundamental of BizTalk is to receive message, process it(if any), and send to the destination since it is an integration tool. Here, you are not sending your received message to anybody so your message is suspended and is in messagebox. The one way to get rid of this message is to create a subscriber for that message. Subscription can be created using Send Port filter, Orchestration Receive Port etc. 
-> If your concern is only about name of the file, you can use FILE.ReceiveFileName property but to get this inside orchestration, you can't directly use passthru pipeline because your XLANG Engine deals with xml message only. So unless you have a xml message you can't read this inside orchestration. 

Now, coming to your scenario, If you are not dealing with PDF at all, you can simply ignore the file in your custom pipeline once you read the filename, and wrap it inside a new xml message and publish this to the messagebox so that your orchestration can subscribe that message and insert entry into the SQL database using SQL adapter.

In case you need that message further, then you can wrap binary content of PDF inside new xml element along with file name in Custom Receive pipeline. In this case you will need to use convert byte array to Base64String using a method like Convert.ToBase64String(byteArray).  On send pipeline, again convert Base64String to byte array and write it into the file (i.e. PDF file). Considering the performance, it is not good to publish entire file into messagebox if your filesize is large. 

I am not sure if you are doing anything with received PDF file. So if could give me the details what you are doing further with the pdf I can recommend you the exact solution.

  re: Updating .pdf file issue in sql

Abhishek Iyer replied to Mohan Raj Aryal
10-Sep-10 02:30 AM

I got the solution. My scenario required BTS to process the Filename and update the corresponding entry in the Sql database-nothing more. What i did was this - I promoted the node responsible for receiving the filename, used a sample receive pipeline and added to it the schema of the filename in a flat file disassembler. In the Orchestration, I chopped off all the unwanted things so that I just had the filename - as in abc.pdf and then passed it to the stored procedure's parameter that is used to update the filename status in the Sql table and it worked fine.

 

Thanks for your help though. I'm sure they will help in some future project and do keep helping, friend.

Create New Account