BizTalk file Archive - biztalk

I have an business requirement where each input file received on FTPS adapter at input location in BizTalk want to send back to client in original format at Archive location (FTPS).
Each input port have inbound map so original message converted and submitted to message box and when I read message on send port its already converted.
How do I get original message and send back to client.

Here as some options to look at
By using a File Archiving Pipeline component as the first thing in the pipeline and writing it to a folder and then having BizTalk pick it up from there using a pass-thru to send it on again.
Have a send port that also subscribed to the converted message that maps it back to the original message and sends it back. This will only be possible if you the original mapping is loss-less (don't lose any information).
Some of the FTP type adapters have the option to move the file after it is transferred rather than just deleting it, if it has use that.

Related

Send Single File to different location through custom disassembler

I am getting a file in receive location and I want to send that file to a repository location as well as want to save that file in database ? I want to done this through custom disassembler ?
Please provide any useful link by which I can get my requiremnet.
BizTalk has a publish-subcribe architecture, which means that whenever something is published to the message box, you can use 1-N subscribers.
This means the easiest scenario would be to use two send ports:
One to send the file to the repository location (FILE adapter)
One to send the file to the database (WCF-SQL adapter or in case of BizTalk 2006 R1, the SQL adapter)
Both would subscribe to the same input message and would need a different outbound map on their send port to map to the correct schemas for your needs.
The subscription is the send port filter, where you can either point to the receive port (BTS.ReceivePortName although this is not a good practice) or to the BTS.MessageType (better approach).
Hope this helps you out!

Is there a way to validate a a BizTalk HIPAA message before the disassembler?

We have a solution that receives HIPAA X12 files using the Multiple schema, then splits them and sends them on to the orchestration. Occasionally the client will send a file with a structural error somewhere in the middle, and the message will be suspended, but only after it's already send a few of the sub-documents on to the orchestration. This is annoying...
What I'd like to do is validate the entire message and suspend it before disassembling it into multiple messages... I know I could do this if I switched to the Single schema, or set Preserve Interchange, but then I have to deal with the splitting somewhere else.
Suggestions? Thanks.
Check the Them->You tab of the Agreement under Local Host Settings.
The default option for Inbound batch processing option is to "suspend Transaction Sets (ST/SE) on error."
Change to "suspend Interchange on Error" and test to see if that satisfies your requirement.
That should work unless the Trading Partner sends files with multiple Interchanges.

Processing Empty Files in BizTalk 2010

I have a receive location in my BizTalk 2010 project, and sometimes that receive location will receive an empty file. The receive pipeline is PassThruReceive. We then have a Send Port that has a filter for that Receive Port Name. So all we are doing is moving the file from the receive location to the send location.
The issue that I'm running into is that in the event that we get an empty file in the receive location, my client wants the file to still be moved to the send port. I know that out of the box, the FILE adapter discards empty files and writes an event to the Event Log stating that it was deleted.
I have followed articles that show a custom FILE adapter accomplishing this task. I have had some success with this custom adapter. The file is picked up. Received by BizTalk and the Send Port successfully sends the file. However, even with this solution, I'm running into an issue in the receive side where the file is locked and cannot be deleted. I have followed various articles on this subject, and I get the same issue every time where the file is locked and can not be deleted.
My question is. Even though batchMessage.Message.BodyPart.Data.Close(); is being called, the stream is still locked. Is there any way for me to find where else BizTalk may be locking the file? Is there any other way of handling this?
One of the articles that I followed is located here: http://biztalkwithshashikant.blogspot.com/2011/04/processing-empty-files-in-biztalk.html
It seems to me that you are running into issues when running your custom FILE adapter multi-server. I bet you are running more than 1 server in the BizTalk Group?
I haven't done this myself, but I heard that getting an adapter to run smoothly multi-server is one of the hardest things to do in BizTalk. The trick is to find a way to be able to share the load between multiple instances of the same BizTalk host.
Do you still have the same problem when running the instance only on 1 server instead of 2?
in the custom pipeline component code method:
IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
You should return pInMsg, not set to null, and the .BodyPart stream positioned at the end. If pInMsg is null BizTalk will discard the message silently. You don't need to close it but you do need to move it to the end to let BizTalk know you read and processed it all.
A way around this is to use the FTP adapter instead to pick up the files, the FTP adapter does not discard empty files.
It is quite possible that to system creating the files, it is still a file location, but also accessible via FTP.

using jqxgrid exportdata to xls causes leaving encrypted connection. How to prevent it?

Im am using jqxgrid export data functionality:
$("#jqxGrid").jqxGrid('exportdata', 'xls', fileName);
But this causes the data to leave encrypted connection and be sent over unencrypted connection. And third party can easily read the data. Since it may be sensitive information, is it possible for me to prevent it from leaving secure connection while still using the feature?
jqWidgets needs to send your grid data to a server, so this server can resend it to the user. This is how the user get the file like a download, you can't do that only on client side.
When you call 'exportdata', it uses a file which is located on jqWidgets' servers. You have to add the URL of your own server to make sure it won't send data to a third party. Look a the API here : http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-api.htm

Outbound Map not being used

I have a receive port. It calls a stored procedure for transport, then the receive pipeline is just passthrureceive (I tried XMLReceive, but that caused many more issues). I have a send port that has the filter set so it picks up the type of the receive port. The send port has a map and send pipeline. The map maps the xml from the receive port to a flat file schema, and then sends it to it's location. THe send pipeline has a flat file assembler.
So the map never runs. I just get errors from the send pipeline saying it can't match the document. No it can't, because it wasn't mapped. I read that you need an XML Disassembler on the recieve pipeline of the receive location. I added that, and that just started destroying my messages. They just get turned into a blank message or just a " in the message. So the XML disassembler is clearly not working right. I'm not sure what to do at this point.
OK, I figured it out. I have to use the XML disassembler to make the map run. The reason it was erasing my messages is, well I don't know the reason, but when I set the schema to "elementFormDefault = Qualified", it worked. I'm not really sure what that did, as I really don't have a good understanding of the whole qualified message thing, but that was the problem for me.
There is a wizard in Visual Studio to help you create the schemas and bindings that you use to communicate with stored procedures. I guess you didn't use that? (Right click on the project, hit "Add", then "Add Generated Items", then "Consume Adapter Service")
I'm calling my stored procedure from an orchestration hooked to two way send/receive port. I'm using a custom WCF type port with XMLTransmit and XMLReceive for the pipelines. This seems to work fine. The caveat being it's always a bit fiddly getting WCF to work since there are so many options.
In order to map from one format to another on ports, you need to have MessageType promoted. In your case it can be accomplished by using XMLReceive on the receive pipeline.

Resources