我们可以将BizTalk Accelerator for RosettaNet代码部署为webapp(azure网站)吗?

时间:2018-02-26 16:18:08

标签: c# biztalk biztalk-2013

我想我们真的只需要Biztalk VM来部署BizTalk Accelerator for RosettaNet c# application code

有没有办法将其部署为webapp(azure网站)代码可以使用Local copy = true的所有dll?并在web.config文件中提供sql数据库连接字符串?

我有来自MSDN的示例代码。

Default.cs

public partial class _Default : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["Submit"] != null)
            {
                string sPipCode = Request["PipCode"];
                string sPipVersion = Request["PipVersion"];
                string sPipInstanceID = Request["PipInstanceID"];
                string sPipCategory = Request["PipCategory"];
                string sPipSource = Request["PipSource"];
                string sPipDestination = Request["PipDestination"];
                string sFileName1 = Request["FileName1"];
                string sFileName2 = Request["FileName2"];
                string sRemark1 = Request["Remark1"];
                string sRemark2 = Request["Remark2"];
                string[] aInputFiles = new string[2];
                string[] aRemarks = new string[2];
                string sContent = Request["ServiceContent"].Trim();

                SubmitRNIF MessageSubmitter = new SubmitRNIF();

                //The message category
                int mc;
                if (sPipCategory.ToUpper() == "RESPONSE")
                    mc = MessageCategory.AsyncResponse;
                else
                    mc = MessageCategory.AsyncAction;

                //Generate a Pip instance ID if the submitted value is null or empty
                if (sPipInstanceID.Length == 0)
                    sPipInstanceID = Guid.NewGuid().ToString();

                //Generate the input attachment files arrary and its associated remarks
                if (sFileName1 != null && sFileName1.Length > 0) aInputFiles[0] = sFileName1;
                if (sFileName2 != null && sFileName2.Length > 0) aInputFiles[1] = sFileName1;
                if (sRemark1 != null && sRemark1.Length > 0) aRemarks[0] = sRemark1;
                if (sRemark2 != null && sRemark2.Length > 0) aRemarks[1] = sRemark2;

                if (sFileName1 == null && sFileName2 == null)
                    MessageSubmitter.SubmitMessage(mc, sPipSource, sPipDestination, sPipCode, sPipInstanceID, sPipVersion, sContent);
                else
                    MessageSubmitter.SubmitMessage(mc, sPipSource, sPipDestination, sPipCode, sPipInstanceID, sPipVersion, sContent, aInputFiles);

                Response.Redirect("QueryData.aspx?PIPInstanceID=" + sPipInstanceID);
                Response.End();
            }

        }
    }

QueryData.cs

public partial class QueryData : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Put user code to initialize the page here

            string IncomingQuery = @"SELECT PIPInstanceID as 'Instance ID', MessageCategory as 'Category', SourcePartyName as 'Source', DestinationPartyName as 'Destination', PIPCode as 'Code', PIPVersion as 'Version', TimeCreated as 'Time' FROM MessagesToLOB WHERE PIPInstanceID like '{0}' ORDER BY TimeCreated ASC";
            string OutgoingQuery = @"SELECT PIPInstanceID as 'Instance ID', MessageCategory as 'Category', SourcePartyName as 'Source', DestinationPartyName as 'Destination', PIPCode as 'Code', PIPVersion as 'Version', TimeCreated as 'Time' FROM MessagesFromLOB WHERE PIPInstanceID like '{0}' ORDER BY TimeCreated ASC";

            XmlDocument xmldoc = new XmlDocument();
            String sResponse = "";

            try
            {
                Request.ValidateInput();

                SqlConnection localConnection = new SqlConnection(RuntimeGlobal.DataDbConnectionString);
                string x = null;
                if (Request["PIPInstanceID"] != null && Request["PIPInstanceID"].Length > 0)
                    x = Request["PIPInstanceID"];
                else
                    x = "%";

                IncomingQuery = string.Format(IncomingQuery, x);

                SqlCommand localCommand = new SqlCommand(IncomingQuery, localConnection);

                localConnection.Open();
                SqlDataReader retReader = null;

                retReader = localCommand.ExecuteReader();
                DataGrid1.DataSource = retReader;
                DataGrid1.DataBind();
                Response.Flush();
                localCommand.Dispose();
                localConnection.Close();


                //Outgoing
                OutgoingQuery = string.Format(OutgoingQuery, x);

                localCommand = new SqlCommand(OutgoingQuery, localConnection);

                localConnection.Open();
                retReader = null;

                retReader = localCommand.ExecuteReader();
                DataGrid2.DataSource = retReader;
                DataGrid2.DataBind();
                Response.Flush();
                localCommand.Dispose();
                localConnection.Close();
            }
            catch (SqlException ex)
            {
                sResponse = "Could not access the database: " + ex.Message;
                Response.Write(sResponse);
            }

        }

1 个答案:

答案 0 :(得分:1)

嗯......虽然它可能,甚至可能,但你可以让它发挥作用,它绝对不能被微软支持。

Stickler将许可,因为没有规定在许可核心以外的任何其他位置运行任何BizTalk SKU位。意思是,即使你可以让它发挥作用,它仍然不合法。

所以,我要说 NO ,VM是您最好的选择。