2008年4月6日

, 哈哈,先做一下标题党,稍后把内容贴上

posted @ 2008-08-29 07:03 upzone 阅读(21) | 评论 (0)编辑

最近发现在配置RosettaNet时候,总是报错: Value cannot be null.很郁闷,因为没办法调出UI配置Agreement,只好在数据库里修改 TPA 信息.

不死心找bug, 反编译Microsoft.Solutions.BTARN.AdminSnapin.dll, 跟踪调试,发现在

public ProcessConfiguration(string displayCode)
        {...

this.fieldActivityProperties.ActivityName = values.Get("Activity_Name");

时候报错:value cannot be null.

 

检查BTARNConfig..PIPConfig表Data字段,发现少了Activity_Name字段,

<key name="Activity_Name" value="Notify of Consumption" />

 

检查Hotfix History,发现原来是打过KB938839 Hotfix,需要更新BTARNConfig数据库.详见KB938839 ,

 

Update_BTARNConfig_PIPConfig.sql

 

USE [BTARNCONFIG]
GO

BEGIN TRANSACTION updatePatch
    SET ANSI_NULLS OFF
    GO

    SET QUOTED_IDENTIFIER ON
    GO

    DECLARE @ActivityName   nvarchar(300)
    DECLARE @lengthPart1    bigint
    DECLARE @nameExists    int
    DECLARE @PIPID        int
    DECLARE @PIPName    nvarchar(256)
    DECLARE @stringPart1    nvarchar(4000)
    DECLARE @stringPart2    nvarchar(4000)
    DECLARE @totalLength    bigint
    DECLARE @totalString    nvarchar(4000)    

    DECLARE data_cursor CURSOR
    FOR SELECT ID,Name,Data FROM dbo.PIPConfig

    OPEN data_cursor

    FETCH NEXT FROM data_cursor
    INTO @PIPID,@PIPName,@totalString

    WHILE @@FETCH_STATUS=0
        BEGIN
            SELECT @nameExists=CHARINDEX('Activity_Name',@totalString)
    
            IF (@nameExists = 0)
                BEGIN

                SELECT @lengthPart1=(CHARINDEX('<key name="Activity_Type"',@totalString)-1),@totalLength=DATALENGTH(@totalString) 

                SELECT @stringPart1=SUBSTRING(@totalString,1,@lengthPart1),@stringPart2=SUBSTRING(@totalString,@lengthPart1+1,@totalLength-@lengthPart1)

                SET @ActivityName='<key name="Activity_Name" value="'+@PIPName+'" />'
    
                SET @stringPart1=@stringPart1+@ActivityName

                UPDATE PIPConfig
                SET data=@stringPart1+@stringPart2
                WHERE ID=@PIPID
                
                END

            FETCH NEXT FROM data_cursor
            INTO @PIPID,@PIPName,@totalString
        END

    CLOSE data_cursor

    DEALLOCATE data_cursor

COMMIT TRANSACTION updatePatch

--------------------------------------------

 

附 PIPConfig Data

<?xml version="1.0" encoding="utf-8"?>
<NameValueCollection>
    <key name="PIP_Code" value="4B3"/>
    <key name="PIP_Description" value="&quot;The &quot;&quot;Notify of Consumption&quot;&quot; Partner Interface Process supports consumption notification within a consignment inventory management process where &#xD;&#xA;-The supplier ships product to a consigned warehouse location based upon receipt of demand forecast and t"/>
    <key name="PIP_DisplayCode" value="TI_STD_4B3_V01.00"/>
    <key name="PIP_InternalID" value="1011"/>
    <key name="PIP_messageStandard" value=""/>
    <key name="PIP_Name" value="Notify of Consumption"/>
    <key name="PIP_nonRosettaNet" value="False"/>
    <key name="PIP_payloadBindingID" value=""/>
    <key name="PIP_Standard" value="RosettaNet"/>
    <key name="PIP_standardVersion" value=""/>
    <key name="PIP_Version" value="V01.00"/>
    <key name="Activity_Name" value="Notify of Consumption"/>
    <key name="Activity_Type" value="Notification"/>
    <key name="Activity_IsSingleAction" value="True"/>
    <key name="Activity_IsSynchronous" value="False"/>
    <key name="Activity_NonRepudiationOfReceipt" value="False"/>
    <key name="Activity_TimetoAcknowledge" value="7200"/>
    <key name="Activity_TimetoPerform" value="86400"/>
    <key name="Activity_Retrycount" value="3"/>
    <key name="Activity_IsAuthorizationRequired" value="False"/>
    <key name="Activity_NonRepudiationofOriginandContent" value="False"/>
    <key name="Activity_IsPersistentConfidentialityRequired" value="None"/>
    <key name="Activity_IsSecureTransportRequired" value="True"/>
    <key name="Initiator_Role" value="Consumption Notification Provider"/>
    <key name="Initiator_RoleDescription" value="The party that creates and sends consumption information to Supplier."/>
    <key name="Initiator_RoleType" value="Organizational"/>
    <key name="Initiator_Service" value="Consumption Notification Provider Service"/>
    <key name="Initiator_ServiceClassification" value="Business Service"/>
    <key name="Initiator_Action" value="Consumption Notification Action"/>
    <key name="Initiator_BusinessDocument_Name" value="Consumption Notification"/>
    <key name="Initiator_BusinessDocument_Description" value="The Consumption Notification contains consumption information includes product identification, quantities; consumption dates, and may include payment reference number and purchase order number."/>
    <key name="Initiator_BusinessDocument_Version" value="V01.00"/>
    <key name="Responder_Role" value="Consumption Notification User"/>
    <key name="Responder_RoleDescription" value="The party that requires consumption information from the customer to manage inventory"/>
    <key name="Responder_RoleType" value="Organizational"/>
    <key name="Responder_Service" value="Consumption Notification Provider Service"/>
    <key name="Responder_ServiceClassification" value="Business Service"/>
    <key name="Responder_Action" value="Consumption Notification Action"/>
    <key name="Responder_BusinessDocument_Name" value="Consumption Notification"/>
    <key name="Responder_BusinessDocument_Description" value="The Consumption Notification contains consumption information includes product identification, quantities; consumption dates, and may include payment reference number and purchase order number."/>
    <key name="Responder_BusinessDocument_Version" value="V01.00"/>
</NameValueCollection>

posted @ 2008-08-27 02:05 upzone 阅读(18) | 评论 (0)编辑

如题,

最近迷上了Flex

posted @ 2008-08-24 10:34 upzone 阅读(19) | 评论 (0)编辑

这几天和TI测试时候发现回复的ACK有问题,对方报出来说ServiceHeader里的SignalControl取值有问题

RNIF version 1.1

1.这是收到的数据

<TransactionIdentity>
        <GlobalTransactionCode>Notify of Advance Shipment</GlobalTransactionCode>
        <InstanceIdentifier>3B2_20080821T0514070001278391</InstanceIdentifier>
      </TransactionIdentity>
      <ActionControl>
        <ActionIdentity>
          <GlobalBusinessActionCode>Advance Shipment Notification Action</GlobalBusinessActionCode>
          <InstanceIdentifier>1219313753728.30291@dleb2be_te</InstanceIdentifier>
          <VersionIdentifier>V01.01</VersionIdentifier>
        </ActionIdentity>

 

2.回复的ACK,变成这样了

<SignalControl>
    <inResponseTo>
     <ActionIdentity>
      <GlobalBusinessActionCode>Advance Shipment Notification Action</GlobalBusinessActionCode>
      <InstanceIdentifier>3B2_20080821T0514070001278391</InstanceIdentifier>
     </ActionIdentity>
    </inResponseTo>

 

3.理论上回复的ACK应该是去下面的InstanceIdentifier

<SignalControl>
    <inResponseTo>
     <ActionIdentity>
      <GlobalBusinessActionCode>Advance Shipment Notification Action</GlobalBusinessActionCode>
      <InstanceIdentifier>1219313753728.30291@dleb2be_te</InstanceIdentifier>
     </ActionIdentity>
    </inResponseTo>

 

现在猜测是RosettaNet Accelerator 的一个bug

翻出代码查看,看到这样几行

string propertyValue = bizMessage.GetPropertyValue(typeof(MessageTrackingID)) as string;

 

其中MessageTrackingID取值XPath为

<b:property name="ns0:MessageTrackingID" xpath="/*[local-name()='ServiceHeader' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='ProcessControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='TransactionControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='TransactionIdentity' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='InstanceIdentifier' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']" />

 

也就是

/*[local-name()='ServiceHeader']/*[local-name()='ProcessControl']/*[local-name()='TransactionControl']/*[local-name()='TransactionIdentity']/*[local-name()='InstanceIdentifier']

果然取的是上面的值,确认是bug

 

怎么办呢,等着测试,要用呢,查找Microsoft KB,果然发现有这方面的问题 support

KB:932368:

FIX: The BizTalk Accelerator for RosettaNet 3.3 incorrectly populates the InstanceIndentifier element in RNIF 1.1 signal messages and response messages in BizTalk Server 2006

 

打好补丁,注意版本号

Microsoft.solutions.btarn.configurationmanager.dll    3.3.2009.0

发现好了,再看发现代码变成了

string propertyValue = requestMessage.GetPropertyValue(typeof(ActionInstanceIdentifier)) as string;

ActionInstanceIdentifier是什么字段,Microsoft.Solutions.BTARN.Schemas.RNIFv11.ServiceHeaderPartMessageGuideline Schema里这样描述

<b:property name="ns0:ActionInstanceIdentifier" xpath="/*[local-name()='ServiceHeader' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='ProcessControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='TransactionControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='ActionControl' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='ActionIdentity' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']/*[local-name()='InstanceIdentifier' and namespace-uri()='http://schemas.microsoft.com/biztalk/btarn/2004/ServiceHeaderPartMessageGuideline.dtd']" />

简化一下就是

/*[local-name()='ServiceHeader']/*[local-name()='ProcessControl']/*[local-name()='TransactionControl']/*[local-name()='ActionControl']/*[local-name()='ActionIdentity']/*[local-name()='InstanceIdentifier']

 

这就对了,有惊无险.测试通过

 

文章写出来并没有强调多少技术,只是谈谈自己从猜测到准确定位bug的过程.我想过程比结果更重要,虽然很痛苦,但是...还是我那句话,痛并快乐着!!!

posted @ 2008-08-22 16:44 upzone 阅读(20) | 评论 (1)编辑

1.Be care of Writing Event Log

A maximum size of 32KB can be written to the Windows Event Viewer. Often, XML messages will exceed this size. If a string longer than 32KB is written, an exception will be thrown, and the orchestration will terminate (unless appropriate exception handling is implemented). There is no limitation to the size when using the Trace.WriteLine method.

尤其在Orchestration里输出ful entity message content的时候

 

2.BizTalk Accelerator for RosettaNet  WebApp Configuration.

一直很奇怪RosettaNet Gateway WebApp的配置信息到底存在哪里,

和Runtime不一样的是,WebApp Configuration是存在注册表里,

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\BizTalk Accelerator for RosettaNet\3.3\Configuration

 

3.Script functoid 里可以用Ctrl + Tab 输入 Tab  来格式化字符串

 

4.There is no support for output parameters when using the SQL Adapter.

posted @ 2008-08-18 11:16 upzone 阅读(28) | 评论 (0)编辑

昨天装好SQL Server 2008 Enterprise RTM,试用下来感觉挺爽的

发现现在T-SQL可以打点下拉了,不错

但是发现一个问题,如果我先create一个sp,然后调用的话,编辑器总是说could not find store procedure(当然执行没有问题).

关掉重新开一下就好了,不知道怎么解决,也许是一个bug.

还有一个很有用的功能,现在Management Studio 里也可以调试T-SQL了,可以下 Break-Point.蛮不错的,不过发现有个问题,他的Quick Watch里不支持SQL语法,比如说watch 一个变量@test,但是如果你写left(@test,3)就不支持了.

 

其他还好,才刚刚上手使用,比较关心的是他的policy 功能.

posted @ 2008-08-14 11:58 upzone 阅读(31) | 评论 (1)编辑

create function f_split(@SourceSql varchar(max),@StrSeprate char(1))
returns @temp table(a varchar(100))
--实现split功能 的函数
as
begin
    --declare @temp as table(a varchar(100))
--declare @SourceSql as nvarchar(max)
--declare @StrSeprate as nvarchar(10)
--set @SourceSql='ABC:BC:C:D:E'
--set @StrSeprate=':'
declare @i int
    set @SourceSql=rtrim(ltrim(@SourceSql))
    set @i=charindex(@StrSeprate,@SourceSql)
    while @i>=1
    begin
        --print substring(@SourceSql,@i+1,1)
        if (substring(@SourceSql,@i+1,1)=@StrSeprate)
        begin
            set @i=charindex(@StrSeprate,@SourceSql,@i+1)
            continue
        end
        insert @temp values(left(@SourceSql,@i-1))
        set @SourceSql=substring(@SourceSql,@i+1,len(@SourceSql)-@i)
        set @i=charindex(@StrSeprate,@SourceSql)
    end
    if @SourceSql<>'\'
       insert @temp values(@SourceSql)
    return
end

------------------------

 

select * from dbo.f_split('ABC::BC:C:D::E',':')

 

结果:

a

----

ABC:
BC
C
D:
E

 

以上SQL修改自 阿良.NET

posted @ 2008-08-03 13:46 upzone 阅读(43) | 评论 (0)编辑

1.unpivot

with T(LOTNO, IDName, DepartmentCode, OperateType, State, ModTime, C1_001_001, C1_001_002, [Value], CreateTime, GetTime, FinishTime, Status)
as
(
select lower(newid()),IDName,@DepartmentCode,0,0,getdate(),C1_001_001,C1_001_002,[Value],getdate(),null,null,'00' from
(
select JC_CYXX.SFZHM as C1_001_001 , JC_CYXX.CYXM as C1_001_002 ,
convert(nvarchar(max),JC_CYXX.SFZHM) as SFZHM,convert(nvarchar(max),JC_CBXX.CBBZ) as CBBZ,
convert(nvarchar(max),JC_CBXX.YXBZ) as YXBZ,convert(nvarchar(max),JC_JTXX.XZDM) as XZDM,
convert(nvarchar(max),JC_JTXX.XZCDM) as XZCDM,convert(nvarchar(max),JC_JTXX.JCDM) as JCDM
from JC_CBXX
left join JC_CYXX on JC_CBXX.HZYLHM = JC_CYXX.HZYLHM
left join JC_JTXX on JC_JTXX.JCDM = JC_JTXX.JCDM  and JC_JTXX.JTHM = JC_CYXX.JTHM  and JC_CYXX.JTHM = JC_JTXX.JTHM
where 1!=2
) p
unpivot
(
[Value] for IDName in (SFZHM,CBBZ,YXBZ,XZDM,XZCDM,JCDM)) as unpt
)
insert into TempTable select * from T

Notes
--1.selected column can not appeared in the unpivot col list,if you want to, please use alias
--2.all of the column specified in the unpivot list must have same datatype and same data size

 

2.SQL 2005 left/right join 问题

原来2000里有时图方便这样写left/right join

select a.a,b.b from tableA a,tableB b where a.a*=b.b

但是在2005里这样写就不对了,

select a.a,b.b from tableA a left join tableB b on a.a=b.b

如果有2000的库升级到2005,又不想修改sql的话,如果没有用到2005的新特性的话,可以这样修改

EXEC sp_dbcmptlevel <DBName>, 80;
GO
 
3.查看临时表存在

if object_id('tempdb..#TC_TableRelation') is null
begin
    CREATE TABLE [#TC_TableRelation](
        [ID] [nvarchar](255) NOT NULL,
        [ViewName] [nvarchar](50) NOT NULL,
        [MasterTableName] [nvarchar](255) NULL,
        [PrimaryKey] [nvarchar](50) NOT NULL,
        [PrimaryValue] [nvarchar](255) NULL,
        [Status] [nvarchar](255) NULL
    ) ON [PRIMARY]
end

或者

if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TC_TableRelation') and type='U')
   drop table #TC_TableRelation

 
4.存储过程是不支持Table类型参数的,解决办法
a).用游标变量代替
b).使用2005里的xml数据类型
   Ref:Passing a Table to A Stored Procedure

posted @ 2008-08-01 11:48 upzone 阅读(24) | 评论 (0)编辑

前几天买了几件衣服,发现有条裤子嫌大,昨天不怎么下雨,就和老婆去换小号的了,一路有说有笑快到了,突然发现裤子没有拿,晕了,还忘在家里,只好折返回去拿,捣鼓了一圈,人么累死了,店员告之,没有小号的了,更加晕倒,最后只好拎着袋子回去了...唉,糗大了!!!

posted @ 2008-07-31 11:14 upzone 阅读(20) | 评论 (0)编辑

是不是有这样的困惑,我安装证书了,但是不知道放到哪个Store里去,随便找个地方放嘛,BizTalk怎么也读不到,我想下面的两幅图最能说明问题了:

Cert.for.BizTalk.SendCert.for.BizTalk.Receive

 

对于Send来说,加密放在Other People 里,而签名证书放在Personal里,Receive刚好相反.

特别注意的是,证书必须要放Current User Root下

 

Reference:BizTalk Online book:Developing BizTalk Server Applications > Implementing Message Security > Sending and Receiving Signed Messages >How to install the Certificates for Digital Signatures

posted @ 2008-07-25 09:31 upzone 阅读(32) | 评论 (2)编辑

如何从数据库中删除全文目录 (SQL Server Management Studio)

本主题说明了如何使用 SQL Server Management Studio 从数据库中删除全文目录。

从数据库中删除全文目录

  1. 在对象资源管理器中,展开服务器组,展开“数据库”,然后展开要删除的全文目录所在的数据库。

  2. 展开“存储”,然后展开“全文目录”

  3. 右键单击要删除的全文目录,然后选择“删除”

  4. “删除对象”对话框中,单击“确定”

posted @ 2008-07-23 13:32 upzone 阅读(28) | 评论 (0)编辑

Error:

The backup of full-text catalog 'BTACScotFT' is not permitted because it is not online. Check errorlog file for the reason that full-text catalog became offline and bring it online. Or BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data.
The backup of full-text catalog 'BTAScotFTIndex' is not permitted because it is not online. Check errorlog file for the reason that full-text catalog became offline and bring it online. Or BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data.


 

Failed to enable full-text indexing.

Enable 对于 FullTextIndex“PK__TestFIX__00551192”失败。  (Microsoft.SqlServer.Smo)

全文目录 'TestFIX' 处于不可使用的状态。请删除此全文目录,然后重新创建它。 (Microsoft SQL Server,错误: 7624)

 

Workaround:

 

USE master
declare @DBId as int
declare @DBName as nvarchar(255)
set @DBName='upzone'

select @DBId=database_id from sys.master_files where name=@DBName
SELECT database_id , file_id , type_desc , name , state_desc , physical_name
FROM sys.master_files
WHERE database_id = @DBId

 

....未完待续....

posted @ 2008-07-22 17:44 upzone 阅读(16) | 评论 (0)编辑

不允许使用内部子集 DTD 分析 XML。请将 CONVERT 与样式选项 2 一起使用,以启用有限的内部子集 DTD 支持

 

在xml data中包含DTD 头,则使用convert(xml,xmldatafield,2)

 

declare @x as xml
select @x=convert(xml,ServiceContent,2)
FROM MessagesToLOB where PIPCode='3B12' and MessageCategory=50 and PIPInstanceID ='7b0a8e91-c202-4da0-8e49-4e122e5f3751'

SELECT @x.value(N'(/Pip3B12ShippingOrderConfirmation/ShippingOrder/OrderConfirmation/GlobalShippingOrderStatusCode/text())[1]','nvarchar(max)') as Confirm,
@x.value(N'(/Pip3B12ShippingOrderConfirmation/ShippingOrder/OrderConfirmation/GlobalShippingOrderStatusReasonCode/text())[1]','nvarchar(max)') AS [ReasonCode]

posted @ 2008-07-19 20:52 upzone 阅读(19) | 评论 (0)编辑

Issue:

The adapter failed to transmit message going to send port "UWSHandling_WS2_Intel" with URL "wse://http://10.33.49.14/KWEIntelIntegration/ServiceToIntel.asmx". It will be retransmitted after the retry interval specified for this Send Port. Details:"Operation Timed Out".

 

Solution:

In the WSE send port configuration dialog window, set the Connection time-out property more large, 3600 or 7200 eg.(120 default,-1 infinite)

WSE.Transport.Properties

Refer to:

In the Connection time-out property, type a numeric value to set the time, in seconds, for the BizTalk Adapter for WSE to wait for a response from the consumed Web service method. A value of -1 refers to an infinite timeout, while a value of 0 is not valid. The default value is 120 seconds.

posted @ 2008-07-18 12:31 upzone 阅读(16) | 评论 (0)编辑

Faulting application w3wp.exe, version 6.0.3790.3959, stamp 45d6968e, faulting module webengine.dll, version 2.0.50727.42, stamp 4333eca4, debug? 0, fault address 0x00002fec.

 

EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 system.web, P5 2.0.0.0, P6 4333aecd, P7 5ce, P8 47, P9 system.cannotunloadappdomain, P10 NIL.

 

w3wp.exe 错误,just like above, 寻求解决方案

posted @ 2008-07-14 23:28 upzone 阅读(45) | 评论 (0)编辑

  1. floor() Returns a number rounded down to the next integer
  2. ceiling() Returns a number rounded up to the next integer
  3. round() Returns a number rounded to the nearest integer

posted @ 2008-07-09 12:20 upzone 阅读(37) | 评论 (0)编辑

1.String Format

(1).小数保留2位小数

decimal.Parse(weight).ToString("F2")

(2).String.Format

string.Format("{0:000.000}", 12.2) 012.200
string.Format("{0:D3}", 2) 002

字符

说明

示例

输出

C 货币 string.Format("{0:C3}", 2) $2.000
D 十进制 string.Format("{0:D3}", 2) 002
E 科学计数法

string.Format("{0:E}", 250000);

2.500000E+005

F

Fixed-point

string.Format("{0:F2}", 25);

string.Format("{0:F0}", 25);

25.00

25

G 常规

string.Format("{0:G}", 2.5);

2.5
N 用分号隔开的数字

string.Format("{0:N}", 2500000);

2,500,000.00

X 十六进制 string.Format("{0:X}", 250); FA
string.Format("{0:000.000}", 12.2) 012.200

2.RosettaNet 中获取 Partner 配置信息

using Microsoft.Solutions.BTARN.Shared;

   1:  private string m_Classification = "";
   2:  private string m_ContactName = "";
   3:  private string m_EmailAddress = "";
   4:  private string m_FaxNumber = "";
   5:  private string m_GbiNumber = "";
   6:  private string m_SupplyChainCode = "";
   7:  private string m_TelephoneNumber = "";
   8:   
   9:  private Microsoft.Solutions.BTARN.Shared.PartyInfo m_partyInfo;
  10:  public PartnerInfo():this("Intel")
  11:  {    
  12:  }
  13:   
  14:  public PartnerInfo(string partnerName)
  15:  {
  16:      m_partyInfo = new PartyInfo(partnerName);
  17:   
  18:      m_Classification=m_partyInfo.GetAliasValue(PartnerPropertyFields.Classification);
  19:      m_ContactName=m_partyInfo.GetAliasValue(PartnerPropertyFields.ContactName);
  20:      m_EmailAddress=m_partyInfo.GetAliasValue(PartnerPropertyFields.EmailAddress);
  21:      m_FaxNumber=m_partyInfo.GetAliasValue(PartnerPropertyFields.FaxNumber);
  22:      m_GbiNumber=m_partyInfo.GetAliasValue(PartnerPropertyFields.GbiNumber);
  23:      m_SupplyChainCode = m_partyInfo.GetAliasValue(PartnerPropertyFields.SupplyChainCode);
  24:      m_TelephoneNumber=m_partyInfo.GetAliasValue(PartnerPropertyFields.TelephoneNumber);
  25:  }

3.SQL 去除 Tab

set @PlantCode=ltrim(rtrim(replace(@PlantCode,char(9),'')))

 

4.SQL XML 查询

 

with TmpTable
as
(
select convert(xml,a.ServiceContent) as ServiceContent,b.ExternOrderKey from PIPsOutHandling a,MessageOutHandling b where a.PIPInstanceID collate SQL_Latin1_General_CP1_CI_AS =b.PIPInstanceID and a.PIPInstanceID collate SQL_Latin1_General_CP1_CI_AS in (select  PIPsInstancesID from EventLog where PIPCode='3B12' and datediff(d,CreateTime,getdate())=1 and Status<>100)  --order by ExternOrderKey asc

)

select ExternOrderKey,ServiceContent.value(N'(/Pip3B12ShippingOrderConfirmation/ShippingOrder/OrderConfirmation/GlobalShippingOrderStatusCode/text())[1]','nvarchar(max)') as [Confirm],
ServiceContent.value(N'(/Pip3B12ShippingOrderConfirmation/ShippingOrder/OrderConfirmation/GlobalShippingOrderStatusReasonCode/text())[1]','nvarchar(max)') AS [ReasonCode]
FROM TmpTable  order by ExternOrderKey asc

posted @ 2008-07-09 10:59 upzone 阅读(19) | 评论 (0)编辑

Import/Include/Redefine

  • Import works only when the two schemas have different Target Namespace attributes.
  • Include is available only when both schemas share the exact same Target Namespace. Also, Include only works when the two schemas do not have any of the same top level element names, attributes, or data types. This is because Include acts essentially like a copy and paste from the original.
  • While Redefine might work as well, it is primarily for situations where an alteration to the source schema elements/attributes is needed.

posted @ 2008-07-06 16:49 upzone 阅读(33) | 评论 (0)编辑

Issue:

There was a failure executing the receive pipeline: "Microsoft.Solutions.BTARN.Pipelines.Receive, Microsoft.Solutions.BTARN.PipelineReceive, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "Pipeline " Receive Port: "RNIF_Async_Receive" URI: "/BTARNHttpReceive/BTSHTTPReceive.dll?xRNResponseType=async" Reason: Party with DUNS "544623812" was not found in BizTalk Explorer.

 

Solution:

 

Check your DUNS(GBI),this error occurs when you type one wrong DUNS in the HOME/Partner configuration.

posted @ 2008-06-27 11:53 upzone 阅读(41) | 评论 (0)编辑

 

How to: Rename a Computer that Hosts a Stand-Alone Instance of SQL Server 2005

1. For a renamed default instance, run the following procedures:
Get SQL SERVER NAME: select @@servername
sp_dropserver <old_name>
GO
sp_addserver <new_name>, local
GO
Restart the SQL Server instance.

2. For a renamed named instance, run the following procedures:
sp_dropserver <old_name\instancename>
GO
sp_addserver <new_name\instancename>, local
GO

Restart the SQL Server instance.

URL: http://msdn2.microsoft.com/en-us/library/ms143799.aspx

posted @ 2008-06-27 11:18 upzone 阅读(40) | 评论 (0)编辑

One-way web service call in BizTalk Orchestration

The default ASP.NET web service behavior is to return a response even if a method returns void, to allow the service to return a fault message. BizTalk Server creates a response message part for the void return. If you are in control of the Web service and it is a .NET Web service, you can specify that a response should not be returned by using the [SoapDocumentMethod(OneWay=true)] attribute, making it truly fire-and-forget.

Sample code looks like this:

[WebMethod]

[SoapDocumentMethod(OneWay=true)]

public void OneWayService ()

{

}

When you add a web reference to your Orchestration project BizTalk now configures the port type to be one-way and the port shape reflects this.

posted @ 2008-06-27 11:15 upzone 阅读(21) | 评论 (0)编辑

The adapter failed to transmit message going to send port "UWSHandling_WS_Intel" with URL "wse://http://10.33.49.14/KWEIntelIntegration/ServiceToIntel.asmx". It will be retransmitted after the retry interval specified for this Send Port. Details:"There was an exception running the extensions specified in the config file. ---> Maximum request length exceeded.".

 

Solution:

在web.config 里system.web下加入下面一行

    <system.web>
    <httpRuntime maxRequestLength="102400"  executionTimeout="3600"/>

 

Notes:

httpRuntime maxRequestLength:单位 K

Optional Int32 attribute.

Specifies the limit for the input stream buffering threshold, in KB. This limit can be used to prevent denial of service attacks that are caused, for example, by users posting large files to the server.

The default is 4096 (4 MB).

 

httpRuntime executionTimeout    

executionTimeout

Optional TimeSpan attribute.

Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.

This time-out applies only if the debug attribute in the compilation element is False. To help to prevent shutting down the application while you are debugging, do not set this time-out to a large value.

The default is "00:01:50" (110 seconds).

posted @ 2008-06-26 18:43 upzone 阅读(99) | 评论 (0)编辑

查阅了MSDN,其实很简单

sp_xml_preparedocument
hdoc 
OUTPUT
[ , xmltext ]
[ , xpath_namespaces ] 
 
You can specify ns using the third parameter.
 

declare @MailContent as nvarchar(max)
select @MailContent=MessageBody from MailStorer where ID=2

--print @MailContent

DECLARE @XmlHandler int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @XmlHandler OUTPUT, @MailContent,'<ns0:RN_4C1_OUT xmlns:ns0="
http://_4C1_InventoryHold_Intel.MailMessage"/>'

SELECT  '4C1 Inventory Hold On/Off' as Header,*
FROM       OPENXML (@XmlHandler, '/ns0:RN_4C1_OUT/InventoryLine',1)
with
(
    Status nvarchar(50) 'Status',
    Date nvarchar(50) 'DocDate',
    IDocNo nvarchar(50) 'IDocNo',
    SKU nvarchar(50) 'SKU',
    Quantity nvarchar(50) 'Qty',
    RequestBy nvarchar(50) 'RequestBy'
)

-- 清除xml文件句柄,释放内存
exec sp_xml_removedocument @XmlHandler

posted @ 2008-06-26 14:37 upzone 阅读(19) | 评论 (0)编辑

Is BizTalk Suited for the Application in Question?

Refer to the fourmain types of BizTalk projects—workflow automation, legacy application integration, trading partner exchange, and organizational message broker scenarios. If your application has any of these types of pieces, BizTalk may be a fit. If not, you need to examine where and why BizTalk is being evaluated.

The key thing to remember in this type of situation is to define early in the solution’s design phase what data will be exchanged with BizTalk, what the schema definitions are, and how data will be returned to the calling application. Another key decision is to decide whether the main application requires a synchronous or an asynchronous response from BizTalk and what the threshold values are for an acceptable transaction. If the calling application needs a subsecond synchronous response from BizTalk to process the message, it is imperative that the system be sized properly to ensure that response times are acceptable. If the communication can be asyn- chronous, it is easier to restrict the flow of messages to an acceptable level either by using a queuing mechanism or some sort of batch processing.

posted @ 2008-06-07 10:39 upzone 阅读(24) | 评论 (0)编辑

SQL Agent Job Remarks

Backup BizTalk Server 
(BizTalkMgmtDb)

Performs backup operations on BizTalk databases that participate
in Distributed Transaction Coordinator (DTC) transactions. Not all
BizTalk databases are part of this job. Also, additional databases
can be added to this job. This job is disabled by default and must
be configured in order to run. Scheduled to perform full backup
daily and log backup every 15 minutes by default.

CleanupBTFExpiredEntries
Job_<BizTalkMgmtDb>

New in BizTalk Server 2006, this SQL Agent job cleans up expired
BizTalk Framework (BTF) entries in the BizTalk Management Data-
base. Scheduled to run every 12 hours and enabled by default.

DTA Purge and Archive 
(BizTalkMsgBoxDb)

New in BizTalk Server 2006, this SQL Agent job automatically
archives data in the BizTalk Tracking (BizTalkDTADb) database and
purges obsolete data. This job is disabled by default and must be
configured in order to run. Scheduled to run every minute by
default.

MessageBox_DeadProcesses_
Cleanup_<BizTalkMsgBoxDb>

Detects when a running BizTalk host instance has stopped. This
SQL Agent job releases all in-progress work for that host instance
so that it can be picked up by another host instance. Scheduled to
run every minute and enabled by default.

MessageBox_Message_
Cleanup_<BizTalkMsgBoxDb>

Removesmessages that are no longer referenced by any
subscribers in the Messagebox database tables. This job is disabled
by default, but it should not be manually run. This job is started
when needed by the MessageBox_Message_ManageRefCountLog_
<BiztalkMsgBoxDb> job.

MessageBox_Message_
ManageRefCountLog_
<BizTalkMsgBoxDb>

Manages the reference count logs for messages. It determines
when a message is no longer referenced by a subscriber.
Scheduled to run everyminute and enabled by default.

MessageBox_Parts_Cleanup_
<BizTalkMsgBoxDb>

Removesmessage parts that are no longer referenced by any
messages in the Messagebox database tables. Scheduled to run
every minute and enabled by default.

MessageBox_UpdateStats_
<BizTalkMsgBoxDb>

New in BizTalk Server 2006, this SQL Agent job manually updates
database statistics for the BizTalk Messagebox database. Sched-
uled to run every 5 minutes and enabled by default.

Operations_OperateOn
Instances_OnMaster_
<BizTalkMsgBoxDb>

New in BizTalk Server 2006, this SQL Agent job is required for
multipleMessagebox database deployments. It performs
perational tasks on Messagebox databases. Scheduled to run
very minute and enabled by default.

PurgeSubscriptionsJob_
<BizTalkMsgBoxDb>

Purges unused subscription predicates fromthe Messagebox
database. Scheduled to run every minute and enabled by default.

Rules_Database_Cleanup
<BizTalkRuleEngineDb>

New in BizTalk Server 2006, this SQL Agent job purges old audit
data from the Rule Engine database every 90 days. It also purges
old history data from the Rule Engine database every 3 days.
Scheduled to run every hour and enabled by default.

TrackedMessages_Copy_
<BizTalkMsgBoxDb>

Copiesmessage bodies of tracked messages from theMessagebox
database to the Tracking database. Scheduled to run every minute
and enabled by default.

 

Note: The SQL Agent job MessageBox_Message_Cleanup_<BizTalkMsgBoxDb> is disabled by default. It is not supported to enable this job or run it manually. This SQL Agent job is managed by the MessageBox_Message_ManageRefCountLog_<BiztalkMsgBoxDb> SQL Agent job.

posted @ 2008-04-08 15:23 upzone 阅读(53) | 评论 (0)编辑

CREATE PROCEDURE PipAutomationGetAction
AS
 SET TRANSACTION ISOLATION LEVEL READ COMMITTED
BEGIN TRANSACTION
DECLARE @tempGUID nvarchar(36)
SELECT TOP 1 @tempGUID = MessageID FROM MessagesToLOB WITH (READPAST,UPDLOCK,ROWLOCK)
   WHERE Delivered = 0 AND MessageCategory = 10
  ORDER BY TimeCreated
  SELECT PIPInstanceID,DestinationPartyName,SourcePartyName,PIPCode,PIPVersion, ServiceContent FROM MessagesToLOB
   WHERE MessageID = @tempGUID
For xml auto
UPDATE MessagesToLOB SET Delivered = 1 WHERE MessageID = @tempGUID
COMMIT TRANSACTION
GO

 

设置SQL Adapter pollWhileDataFound = true

(Specify whether to submit additional batches until the stored procedure or query returns no results, or submit a single stored procedure or query result for each polling interval.)

 

Note:

If you create two or more SQL adapter receive locations against the same SQL database, BizTalk Server will generate the same URI property for both. Because BizTalk Server does not allow for duplicate URI properties, you must manually change the properties so that they are unique. For example, if you have two receive locations that each have a URI value of SQL://./Northwind/, leave one of them as SQL://./Northwind/ and change the other to SQL://./Northwind/Secondary/. This value appears in the SQL Transport Properties dialog box, when configuring a receive location in the BizTalk Server Administration Console.

posted @ 2008-04-06 20:29 upzone 阅读(81) | 评论 (0)编辑