简体   繁体   English

BizTalk 2013 - 在没有编排的情况下在发送端口上执行存储过程?

[英]BizTalk 2013 - execute stored procedure on send port without orchestration?

A while back I set up BizTalk to pick up a file via FTP and drop it into a network directory. 前段时间我设置BizTalk通过FTP获取文件并将其放入网络目录。 It's all passsthru so I didn't use an orchestration. 这都是passsthru所以我没有使用编排。

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. 这可以通过使用WCF-SQL适配器或带有SQL绑定的WCF_Custom适配器来实现。 You can do this using messaging only with just a SendPort with a filter/map on it thus no orchestration needed. 您只能使用带有过滤器/映射的SendPort进行消息传递,因此不需要编排。

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: 对于SOAP操作标头,请使用TypedProcedure / dbo / name_of_your_stored_procedure,在消息选项卡中,您可以指定存储的procuders的参数,并以下列方式添加有效负载:

<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. 在上面的例子中,xml_parameter将传递给它的消息有效负载的内容。

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 关心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." MSDN页面描述了该过程,并说:“您必须创建一个BizTalk业务流程才能使用BizTalk Server在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. 理论上这应该有效,但我无法保证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM