I have a BizTalk 2009 send port that uses the %datetime_bts2000% macro in the file name. When I look at the tracked message event, I don't get the name of the actual file that was sent. I thought I could get it from the context property:
OutboundTransportLocation
SFTP://xxx#xxxx.xxx.com:22/Inbound/Encrypted/xxx.xxx.xxx.201101280410324
Promoted
http://schemas.microsoft.com/BizTalk/2003/system-properties
It turns out that the date is equivalent to my deployment date... not the actual date time stamp of the sent file.
Where do I find the actual filename generated by the Macro?
I happen to agree with #Bryan. I have in fact created such a pipeline to preserve OR set the attachment file name explicitly in a pipeline that I use for email.
Related
A while back I set up BizTalk to pick up a file via FTP and drop it into a network directory. It's all passsthru so I didn't use an orchestration.
Now I've been asked to execute a stored procedure once the file is picked up. The procedure contains no parameters and I do not need the contents of the file.
It seems like such a simple request but I can't figure it out. Is there any way to do this without over complicating things?
This can be accomplished through the use of either the WCF-SQL adapter or the WCF_Custom adapter with a SQL binding. You can do this using messaging only with just a SendPort with a filter/map on it thus no orchestration needed.
For the SOAP action header use TypedProcedure/dbo/name_of_your_stored_procedure and in the messages tab you can specify the paramters to the stored procuders as well as add a payload in the following manner:
<name_of_your_stored_procedure xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo">
<parameter1>XXXX</parameter1>
<xml_parameter>
<bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/>
</xml_parameter>
</name_of_your_stored_procedure>
In the above case xml_parameter will have the contents of the message payload passed to it.
The stored procedure should look something like :
CREATE PROCEDURE [dbo].[name_of_your_stored_procedure]
#parameter1 int,
#xml_parameter nvarchar(max)
AS
BEGIN
-- your code goes here
END
More details can be found here
Regards Hasse
This MSDN page describes the process and has this to say: "You must create a BizTalk orchestration to use BizTalk Server for performing an operation on SQL Server."
However if you're really desperate not to use an orchestration I believe you have the option of setting the operation context property in a custom pipeline component. Then you can initialise the message in a map on a port. In theory this should work but I can't guarantee it.
I want to create a send port that writes all messages going in and out of BizTalk to file.
My organization is using Splunk. Splunk will import data from the file directory to make sense of the various messages.
Is it possible to create filter in a send port that subscribes to "everything"? I could solve this by applying filter for each message type in my system. However, there is a lot of messages going back and forth and I'm wondering if there a simpler solution?
I'm using BizTalk 2013.
Yes, just filter on message type like you said, but rather than selecting = and specifying the message type, just select Exists. That will then match any message that has a message type.
EDIT:
As Johns-305 has pointed out if you have any messages that don't have a message type (e.g. pass through receive locations) you may want to pick BTS.MessageID as that will always exist for a message in the message box.
So, here's the scenario. I have a site which allows you to perform certain operations on files, which take on the order of seconds. I don't want the client to have to wait that long before the server returns a response so they way we have it now is that
User performs an operation in their browser (client)
Client sends a POST request to server with parameters
Server adds operation to job queue and sends back the expected url of the result
Client pings server until file is available then serves it
Currently these files are being stored in my ec2 server but I want to move this to S3. I was wondering if this type of flow is possible.
The server knows what the file will be saved and to where way before it actually is, so is that the same case with S3? Is there a way of knowing the file URL if I know all the information beforehand (bucket, filename, etc)?
All S3 object URLs follow patterns, so it's easy to know what the URL will be ahead of time.
If the bucket name is DNS-compliant (required of all regions except for US Standard), then it'll look like this:
<bucket>.s3.amazonaws.com/<object-path>
The U.S. Standard region is a bit more lax in it's bucket name rules (they aren't required to be DNS-compliant), so some may look like this:
s3.amazonaws.com/<bucket>/<object-path>
So, if your bucket name is something DNS-compliant (e.g., example), and your file is abc/123/file.txt, then your object URL will be:
example.s3.amazonaws.com/abc/123/file.txt
So, if your bucket name is NOT DNS-compliant (e.g., EXAMPLE_123), and your file is abc/123/file.txt, then your object URL will be:
s3.amazonaws.com/EXAMPLE_123/abc/123/file.txt
Here's an example of the DNS-compliant logic from the official PHP SDK.
https://github.com/aws/aws-sdk-php/blob/master/src/Aws/S3/S3Client.php#L293-L317
Is it possible to make the send port change output location based on a promoted property?
We have an interface that needs to send it to a different port based on the client. But we add clients on a regular basis, so adding a new send port (both in the administrator and orchestration) will require a lot of maintenance, while the only thing that happens is a directory change
The folders are like this ...
\\server\SO\client1\Out
\\server\SO\client2\Out
\\server\SO\client3\Out
I tried using the SourceFilename to create a file name like client1\Out\filename.xml but this doesn't work.
Is there any way to do this with a single send port?
It is possible to set the OutboundTransportLocation property in context. This property contains the full path/name of the file that will be output by the file adapter. So in your case I guess you could do something along the line (if it had to be done in a pipeline component):
message.Context.Write(
OutboundTransportLocation.Name,
OutboundTransportLocation.Namespace,
string.format(#"\\server\SO\{0}\Out", client));
Of course you can do a similar thing in your orchestration.
No need of a dynamic port...
My company uses BizTalk for our EDI and AS2 communications. One periodic issue is that a VAN or similar partner we transmit with will want to know whether we received a file by it's ISA #. We currently do use the ISA # for routing within our ports, but I can't seem to find anywhere that this information is stored in BizTalk. Is there a way to look up an EDI message that BizTalk recieved by ISA#? Or perhaps someway I could get a hold of it and store it on my own?
If you're not explicitly using Business Activity Monitoring (BAM) to track this, you may be able to use message tracking.
If you have:
message tracking turned on for the message properties at a point in processing the messages when the ISA number is used, and
if the ISA number is promoted in a published schema (which I'm guessing it is, if you're using the out-of-the-box EDI stuff)
...then you could use the admin console to look for tracked messages with that schema and based on the particular field in the schema (e.g., EDI.ISA08 or EDI.ISA06). Of course, if you are mapping the ISA# to a particular party through your BizTalk configuration, then you would just need to search for Tracked Message Events where the Party Name equals the name you configured for that ISA#.
There is also built-in EDI tracking (see http://msdn.microsoft.com/en-us/library/bb226464(v=bts.10).aspx), with its own reports, but I'm not familiar with it enough to say whether or not it'll give you exactly what you need.
Otherwise, you will want to look at setting up BAM to save the ISA info that you need.
These fields are available inside the Biztalk message if you do EDI receive.
msgIn(EDI.ISASegment) contains all ISA segments. Then you can do substring on control numbers and then put it in your outgoing filename:
ctrlnum (variable) = msgIn(EDI.ISA13)
newfilename = FILE.ReceivedFileName + ctrlnum ;
This way each control number will show up in your filename and you don't even need to open the file or check tracked messages.