Sending a Received File’s Name to Database

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Sending a Received File’s Name to Database

Viewing 1 reply thread
  • Author
    Posts
    • #18526

       I am currently working on a project that requires me to pick up a file from a specific folder and post it to a partner’s website via HTTPS. Once our partner processes the file they create a log file that we again pick up from them via a separate windows component (since it’s done via HTTPS).

       The problem I am having is that I want to be able to run a report which tells me what files have been sent but that we have not logged.

       In order to do this I want to write the name of the file and also a BatchID (since we work with multiple trustees and administrators and file names aren’t necessarily unique across all these trustees and administrators) to a table

      I have already created the stored procedure that will insert the values I need into a table and have generated an adapter off of that. But I am running into problems with the SQL send port and how to go about giving it the information I need.

      I am not all that familiar with orchestration but I originally tried constructing a message that held FILE.ReceivedFileName and also BatchID (which is a promoted property in a referenced property schema) but I run into “use of unconstructed message” errors.

       Is it even possible to accomplish what I need through the message context? Should I be using map shapes instead? I am admittedly not an expert on orchestration whatsoever but it seems to be the only way I can accomplish this. 

      Any help would be greatly appreciated. I am using BizTalk server 2004

    • #18540

      Hi there

      It seems to me that your approach is correct. Whenever I have had to capture the file name I use the FILE.ReceivedFileName property. You do know though that it returns the whole path – well at least it has for me – c:\somefolder\anotherfolder\somelocation\somefile.xml. I have had to do some SQL magic to extract just the file name. Anyway back to your issue ….
      It has been a while since I did this but I assume that you have a receive port that picks up a file and places the contents into a message:
      You then have a string variable that grabs the file name like so ….

      myString = msgReceiveMessage(FILE.ReceivedFileName)
      and it is telling you that msgReceiveMessage is unconstructed and therefore cannot be used?

      Correct so far? Feel free to correct me and I am sure that we will solve your issue together 🙂

      JMan 

      • #18546

         Yes that is the exact issue, but the orchestration is a bit more
        complex than that because I also need to store an adminstrator id
        (which is a promoted property from a property schema).  This forces me
        to use a multi-part message and a solicit-response send port (at least
        I think it forces me to).

        When I tested it using just the myString =
        msgReceiveMessage(FILE.ReceivedFileName) with a static one-way send
        port it seemed to be fine but I run into problems when I try to piece
        it all together.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.